- Notifications
You must be signed in to change notification settings - Fork18
Node.js RESTful API Service based on Express.js 4
License
NotificationsYou must be signed in to change notification settings
simdo/rest.api
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This is the RESTful API Service. It's base example include token authorisation and sample of CRUD (create, read, update, delete) operations.
To store user accounts and other information i use
mongodb
. If you want you can use localmongodb
server or you can use free plan for example frommlab. How to create database on mlab seedocsMake project directory and initialise npm project
mkdir restapicd restapinpm init
- Install base node packages
npm install --save bcrypt body-parser express jsonwebtoken mongoose mongoose-timestamp postmark
- You can clone this project and skep 1 and 2 steps by
git clone git@github.com:simdo/rest.api.git
ordownload source project files
- Create environment file
env.json
on the root project folder
touch env.json
- Put the following code into
env.json
{"product" :"RESTful API Service","company" :"Company Name, LLC","api" : {"version" :"v1.0" },"port" :3000,"hosts" : {"api" :"api.domain.name","app" :"app.domain.name" },"environment" :"development","mongodb" :"mongodb://user:password@id.mlab.com:port/dbname","secret" :"Some super sercet string for JSON Web token","postmark" : {"secret" :"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX","welcome" :1272561,"reset" :1272761,"password" :1279242,"security" :1279241 },"from_email" :"Service Robot <robot@domain.name>","to_email" :"support@domain.name"}
- Start project
node index.js
- Use for examplePostman for test you Restful API server
This project adheres toSemantic Versioning.Every release, along with the migration instructions, is documented on the GithubReleases page.
MIT