restful-api-starter

2.0.1 • Public • Published

REST api server starter (using JWT, express and mongoose)

Main tools used:

JWT, express, mongoose, axios, nodemailer

How to start:

  1. install mongodb , nodemon, babel(5.8.34) globaly

  2. start mongodb: mongod --dbpath YourDBPath;

  3. in config.js

    1. change DATABASE to YourDBPath
    2. set your SECRET
    3. set your EMAIL_SENDER used to send verification email
    4. set your EMAIL_RECEIVING_VERIFICATION to accept verification email(for test)
  4. run the server: npm start

test:

run npm test

I tested the api using axios. Axios is an HTTP client for the browser and node.js. This means you can resuse the code in your web app to do ajax requests.

What does this starter do for you

  1. sign up (with email verification(using JWT))
  2. login (use name and password)
  3. middleware to verify user for private route(using JWT)

API description

TODO

TODOs:

Untested routes:

  • user/emialVerification
  • /needingTokenAndVerified (with email verified)

Readme

Keywords

Package Sidebar

Install

npm i restful-api-starter

Weekly Downloads

0

Version

2.0.1

License

MIT

Last publish

Collaborators

  • timqian