Git Product home page Git Product logo

rest.api's Introduction

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 local mongodb server 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.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:[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

rest.api's People

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.