No description
  • JavaScript 98.8%
  • Shell 1.2%
Find a file
2017-01-09 00:00:00 +01:00
src log more, debugging 2017-01-09 00:00:00 +01:00
test Adding ranking order 2017-01-07 11:52:04 +01:00
.babelrc Added tournament 2016-12-23 01:08:19 +01:00
.gitignore Adding ranking order 2017-01-07 11:52:04 +01:00
jsdoc.json Added a basic api 2016-10-03 13:22:52 +02:00
LICENSE Added a basic api 2016-10-03 13:22:52 +02:00
package.json fixing coveralls 2017-01-07 00:35:29 +01:00
players.md Added tournament 2016-12-23 01:08:19 +01:00
README.md Adding ranking order 2017-01-07 11:52:04 +01:00
test-watch.sh Adding signups 2017-01-06 00:20:56 +01:00
tournaments.md Added tournament 2016-12-23 01:08:19 +01:00
wallaby.js Added signup and changed linter 2017-01-04 19:47:44 +01:00
yarn.lock Adding signup test 2017-01-04 23:20:59 +01:00

Beachvolleyball REST API

Coverage Status Dependency Status Codeship Status for SindreSvendby/enchanted-debug

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