Node.js RESTful API Service based on Express.js 4
This is the RESTful API Service. It's base example include token authorisation and sample of CRUD (create, read, update, delete) operations.
Getting started
-
To store user accounts and other information i use
mongodb. If you want you can use localmongodbserver or you can use free plan for example from mlab. How to create database on mlab see docs -
Make project directory and initialise npm project
mkdir restapi
cd restapi
npm 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 [email protected]:simdo/rest.api.git
or download source project files
- Create environment file
env.jsonon 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:[email protected]: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 <[email protected]>",
"to_email" : "[email protected]"
}- Start project
node index.js
- Use for example Postman for test you Restful API server
Change Log
This project adheres to Semantic Versioning. Every release, along with the migration instructions, is documented on the Github Releases page.
License
MIT

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
