No description
  • JavaScript 98.8%
  • Shell 1.2%
Find a file
2017-02-27 22:14:19 +01:00
src signup api based on player-api 2017-02-27 20:54:07 +01:00
test signup api based on player-api 2017-02-27 20:54:07 +01:00
.babelrc signup api based on player-api 2017-02-27 20:54:07 +01:00
.gitignore signup api based on player-api 2017-02-27 20:54:07 +01:00
jsdoc.json signup api based on player-api 2017-02-27 20:54:07 +01:00
LICENSE signup api based on player-api 2017-02-27 20:54:07 +01:00
package.json signup api based on player-api 2017-02-27 20:54:07 +01:00
player.md First draft of api to math the app 2017-02-27 22:14:19 +01:00
README.md First draft of api to math the app 2017-02-27 22:14:19 +01:00
test-watch.sh signup api based on player-api 2017-02-27 20:54:07 +01:00
treninger.md First draft of api to math the app 2017-02-27 22:14:19 +01:00
treningsgrupper.md First draft of api to math the app 2017-02-27 22:14:19 +01:00
wallaby.js signup api based on player-api 2017-02-27 20:54:07 +01:00
yarn.lock signup api based on player-api 2017-02-27 20:54:07 +01:00

Signup REST API

Coverage Status Dependency Status Codeship Status for osvb/signup

Usage (Clients)

Endpoints

Development

Database

To setup the project locally install Postgres and set PG_URL to your database. The format should postgres://USERNAME:PASSWORD@localhost/DB. The capitalized words should be replaced with your own values.

To export your variable on a Unix-system, simply use the export command, i.e. export PG_URL=your value.

Local production environment

Run npm run build to get a transpiled version of the API, then start with npm start.

Local development environment

If you're gonna develop:

  1. Install nodemon npm install -g nodemon
  2. Run npm run start:dev Remember that you can run it with environment variables in before the command, i.e. PG_URL=value npm run start:dev.

This will watch for changes and keep the application open for you.

Usage

  1. Create your models with Sequelize and place in models/. Look at the example for inspiration.
  2. Create a controller for the new entity by extending the common CRUD controller. See controllers/example.controller.js
  3. Create routes for the entity, see routes/example.routes.js.
  4. Rename the namespace in line 7 of models/index.js

That's about it.

Tests

Single run

  • Run unit tests & code lint with npm test. This will use your local database.
  • Run just unit tests with npm run tests with NODE_ENV=test. This will use your local database.

Watch

Run the unit tests continuously with npm run test:watch, only the tests currently worked on will run when updated. All tests will run when a server file is updated. This will use your local database.

Credit

Thanks to essoen for a good boilerplate