/rest-api-nodejs-mongoose-express-es6

Simple CRUD Api with Node.js+Mongoose+Express+ES6

Primary LanguageJavaScript

Restful API with Mongoose & Express & React & mocha

This is simple CRUD for user preferences using Node.js, MongoDB and React.

Requirements

  • Node.js v8.2.1
  • MongoDB v3.4.6

Prerequisite

  • pure ES6/7 and Node.js 8.x
  • React/InfernoJS
  • Express
  • MongoDB
  • Async/Await
  • Session handling
  • Test with mocha and chai
... install
$ npm install
... for data installation and basic backend api test
$ npm test  
$ npm run-script start

API List

ROUTE METHOD DESCRIPTION
/users GET get all the users
/users/:user_id GET get user and session info by _id
/users/ POST create user
/users/ DELETE delete user by user session
/preferences GET get preferences by user session
/preferences POST create preferences by user session
/preferences PUT update preferences by user session
/preferences DELETE delete preferences by user session

User and Preferences JSON Format

{
    "user_name": "JK Jung",
    "location": "Seoul",
    "content": {
        "category_lists":"enable"
    },
    "privacy": {
      "profile_visibility": "everyone",
      "messages": "everyone"
    },
    "localization": {
      "language": "한국어",
      "time_zone": "Asia/Seoul",
      "currency": "KRW"
    }
}
... todo
  • Add basic front-end test
... issues
  • solved all the issues
... reference