Skip to content

guns2410/boilerplate-api-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

API Server

This is a boilerplate for creating an api server. Please follow the install instructions below:

Using the boilerplate

Step 1: Clone the Repo

git clone https://github.com/guns2410/boilerplate-api-server.git <folder_name>

Step 2: cd into the repo

cd <folder_name>

Step 3: Install dependencies

npm install

OR

yarn install

Adding an api endpoint

Step 1: Create an api endpoint

Write your API Endpoint business logic in ./src/api/<filename>.js

Step 2: Add to index.js file for import management

Step 3: Map the file with a URL in <root_dir>/index.js

Running the API Server

For running the server in DEV mode

npm run dev

OR

yarn dev

Running in production

npm start

OR

yarn start

Testing the API Server

For running tests

npm test

OR

yarn test

For test coverage

npm run test:coverage

OR

yarn test:coverage

About

A boilerplate for creating api-servers

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published