Skip to content

ChristopherKnightMerritt/api-server

Repository files navigation

Build Status

Generic API Server

Summary:

This is a template backend api server that uses node.js and mongoDB, which can be built on top of to support additional APIs. Mongo models can easily be added to add new endpoints.

Link to live server:

https://generic-api-server.herokuapp.com/api/v1/book

Endpoints:

Current end points:

  • GET /api/v1/book/

  • POST /api/v1/book/

  • GET /api/v1/book/:id

  • POST: /api/v1/book/:id

  • PUT: /api/v1/book/:id

  • DELETE: /api/v1/book/:id

Adding new models:

  • Create a new folder with the name of the model to add
  • Create two files in that folder - one for the model, one for the schema.
  • The model needs to extend the generic mongo-model, and additional functionality can be added on this file.

Ex: Adding a model for a 'project':

Models
│   mongo-model.js  
└─── book
│   │   book-model.js
│   │   book-schema.js 
└─── project
    │   project-model.js
    │   project-schema.js

About

An API server to be used as a generic back end.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors