Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Node.js RESTful API Service based on Express.js 4

License

NotificationsYou must be signed in to change notification settings

simdo/rest.api

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.

Getting started

  • To store user accounts and other information i usemongodb. If you want you can use localmongodb server or you can use free plan for example frommlab. How to create database on mlab seedocs

  • Make 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 fileenv.json on the root project folder
touch env.json
  • Put the following code intoenv.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

Change Log

This project adheres toSemantic Versioning.Every release, along with the migration instructions, is documented on the GithubReleases page.

License

MIT

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp