Code Monkey home page Code Monkey logo

aboutapi's Introduction

HNG9 Tasks

Built With Laravel

Getting Started To get a local copy up and running follow these simple steps.

Prerequisites

  1. This project ships with a .env.example file in the root of the project. Rename this file to just .env
  2. Project dependencies are managed through the PHP Composer tool.
  3. In order to install the Javascript packages for frontend development, you will need the Node Package Manager.

Installation

  1. Clone the repo
git clone https://github.com/akoshodi/aboutapi 
  1. Install Composer packages. Navigate into the root of the project in terminal and type this command to install the depencencies:
composer install

  1. Install NPM packages. Run this command from the root of the project:
npm install
  1. 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.

  1. 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
  1. NPM Run '*' Run npm run dev to build the styles and scripts.

  2. Launch site

Use Laravel's artisan serve command to start PHP's built-in development server.

REST Endpoints

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" 
}

aboutapi's People

Contributors

akoshodi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.