JIoffe / NodeExample

Example Node.js and Express project

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node.js & Express Example

Example of basic Node.js application using express. This presents an API using JWT tokens for authentication.

Sample tests with Mocha and Chai are also provided.

To run, first execute npm install to build dependencies, then npm run start:dev to run with nodemon. Otherwise, npm run start will run without watching for file changes. To run tests, execute npm run test.

Endpoints

  • GET / - index page rendered in PUG. Provided only as an example.
  • GET /api/inventory - return all inventory items
  • POST /api/inventory - create inventory item
  • PUT /api/inventory/{id} - alter inventory item with {id}
  • DELETE /api/inventory/{id} - delete inventory item with {id}
  • POST /oauth/token - request bearer token

About

Example Node.js and Express project

License:GNU General Public License v3.0


Languages

Language:JavaScript 93.4%Language:Pug 3.8%Language:CSS 2.6%Language:Shell 0.3%