"Falcon follows the REST architectural style, meaning (among other things) that you think in terms of resources and state transitions, which map to HTTP verbs." - http://falconframework.org/
There are just a couple of configurations managed as environment variables. In the development environment, these are injected by Docker Compose and managed in the docker-compose.yml
file.
DATABASE_URL
- This is the connection URL for the PostgreSQL database. It is not used in the development environment.DEBUG
- This toggles debug mode for the app to True/False.SECRET_KEY
- This is a secret string that you make up. It is used to encrypt and verify the authentication token on routes that require authentication. This is required. The app won't start without it.
Database migrations are handled by Flyway and files are stored in the /sql
directory. Migrations are automatically applied when running tests with Nose. You can run migrations manually in the development environment using docker-compose
too. To do this you will first need to identify the IP address assigned to the database by checking available environment variables.
docker-compose run web ./local_migrate.sh
Tests, with code coverage reporting can be ran with the following command:
docker-compose run web nosetests -v --with-coverage --cover-package=app --cover-xml --cover-html
POST:
/v1/authenticate
Body:
{
"email": "something@email.com",
"password": "12345678"
}
Response:
{
"token": "reallylongjsonwebtokenstring"
}
Status Codes:
200
if successful400
if incorrect data provided401
if invalid credentials
POST:
/v1/user
Body:
{
"email": "something@email.com",
"password": "12345678"
}
Response:
{
"token": "reallylongjsonwebtokenstring"
}
Status Codes:
201
if successful400
if incorrect data provided409
if email is in use
POST:
/v1/password-reset/request
Body:
{
"email": "something@email.com"
}
Response: None
Status Codes:
201
if successful400
if incorrect data provided
POST:
/v1/password-reset/confirm
Body:
{
"code": "6afc2148-5e2f-4c71-93a9-d250f90fccc2",
"password": "MyNewPassword"
}
Response: None
Status Codes:
200
if successful400
if incorrect data provided401
if code not valid