Skip to content

SushiFu/api-samples

Repository files navigation

RESTful Sample API

Features

  • Users
    • JWT Auth: Authorization Header & Cookie
    • Routes restriction by roles & owner
    • Password hash & salt by Bcrypt
  • Public Profiles
    • Search by username using ElasticSearch
    • List only by admin
  • Feedbacks
    • Create only by logged user
    • List only by admin
    • Delete/Update only by admin or owner

Setup

  • Docker w/ Nodemon
  • Debug directly in VSCode
  • ES6 w/ Babel
  • Gulp Tasks
  • ESLint
  • Unit Testing

Prerequisites

Build

$ yarn install
$ yarn build #or run Build Task in VSCode

Launch in Dev (w/ Nodemon)

$ yarn start #for hot-reload just build in VSCode

Debug

$ yarn start
# Then just put some breakpoints and start "Localhost" config in Debug panel
# VSCode debugger will just attach to the docker node instance

Test

$ yarn lint
$ yarn test

Cleanup

$ yarn reset
# If you respond "y" you will loose every data in your databases

About

Collections of ready-to-code NodeJS API samples

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published