This is the API server for the beenest app.
Name | Description |
---|---|
src/middlewares | Express middleware: logging, error handling etc. |
src/services | Communications with other services: 3rd party services, payment services, image uploading, |
src/controllers | Controllers define functions that respond to various http requests |
src/models | Models storing and retrieving data from DB |
src/server.js | Entry point to your express app |
Most configuration of Beenest is done via environment variables defined in a
.env
file.
(The linked file is appropriate for development; other versions will be appropriate
for different deployments.)
We use two additional variables to define environments:
NODE_ENV This lets node know which environment to compile/run in.
development
- whenAPP_ENV == development || test
production
- whenAPP_ENV == testnet || staging || production
APP_ENV We use a separate variable to specify our app-specific settings like database connections.
This can be:
development
- running on your local machinetest
- running unit and functional testsstaging
- https://api-staging.beetoken.comproduction
- https://api.beetoken.com
- Option A Install Node and npm.
npm i
npm run dev
- Option B (This is helpful when you want to run a local version of MySQL)
docker-compose up
npm test
When you merge a PR into master
, AWS Codepipeline will deploy to staging: https://api-staging.beetoken.com/
https://us-west-2.console.aws.amazon.com/codepipeline/home?region=us-west-2#/view/beenest-backend-master-pipeline
When you merge master
into production
branch, AWS Codepipeline will deploy to production: https://api.beetoken.com/
https://us-west-2.console.aws.amazon.com/codepipeline/home?region=us-west-2#/view/beenest-backend-production-pipeline