- Install with
yarn install
- Start server with
yarn start
- Run tests with
yarn test
METHOD | URI | INPUT | OUTPUT |
---|---|---|---|
PUT | /api/user | {username, email, password} | Success message or errors |
GET | /api/user?q=query | query string | List with found users or errors |
PUT | /api/message | {message, sender, receiever} | Success message or errors |
GET | /api/message/userId/sent | List of messages sent by user or errors | |
GET | /api/message/userId/received | List of messages received by user or errors |
Code is found in the src/
folder and tests are placed in folders named with _tests_
.
controllers/
- Controllers for endpointsmodels/
- Models for input validationutils/
config.js
- Config and constantsdatabase.js
- Write and read from filesfunctions.js
- Re-used functionsrouter.js
- Register and handle http requests
index.js
- Where server gets started
dist/
- Built code (get built when runningyarn start
)db/
- "Database files" (created if not exists when runningyarn start
throw thecreate-db-files.js
script)coverage/
- Code coverage
- Encrypt passwords with
bcrypt-nodejs