Built With Laravel
Getting Started To get a local copy up and running follow these simple steps.
- This project ships with a .env.example file in the root of the project. Rename this file to just .env
- Project dependencies are managed through the PHP Composer tool.
- In order to install the Javascript packages for frontend development, you will need the Node Package Manager.
- Clone the repo
git clone https://github.com/akoshodi/aboutapi
- Install Composer packages. Navigate into the root of the project in terminal and type this command to install the depencencies:
composer install
- Install NPM packages. Run this command from the root of the project:
npm install
- Create Database
Create your database on your server and in the .env file update the following lines:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
Change these lines to reflect your new database settings.
- Artisan Commands
The first thing we are going to do is set the key that Laravel will use when encrypting.
php artisan key:generate
You should see a green message stating your key was successfully generated. As well as you should see the APP_KEY variable in your .env file reflected.
Run the built in migrations to create the database tables:
php artisan migrate
-
NPM Run '*' Run npm run dev to build the styles and scripts.
-
Launch site
Use Laravel's artisan serve command to start PHP's built-in development server.
GET /api/profile
Sample response
{
"slackUsername": "hnguser",
"backend": true,
"age": 30,
"bio": "Backend developer"
}
POST /api/calculate
Sample response
{
“slackUsername”: "hnguser",
“result”: 54,
“operation_type”: "addition"
}