docker run --name database -e POSTGRES_PASSWORD=docker -p 5432:5432 -d postgres
npm i -g @adonisjs/cli
adonis migration:run
adonis migration:rollback
adonis serve --dev
HOST=127.0.0.1
PORT=3333
NODE_ENV=development
APP_NAME=AdonisJs
APP_URL=http://${HOST}:${PORT}
CACHE_VIEWS=false
APP_KEY=qMyewmTm5zBxqReEMKZve4a6ASwKJrMy
DB_CONNECTION=pg
DB_HOST=127.0.0.1
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=12345
DB_DATABASE=DB_DEV_COBRA_CAFEINADA
HASH_DRIVER=bcrypt
MAIL_HOST= smtp.mailtrap.io
MAIL_PORT= 2525
MAIL_USERNAME= c60c4aec9c6316
MAIL_PASSWORD= 1d714f3778766b
This is the boilerplate for creating an API server in AdonisJs, it comes pre-configured with.
- Bodyparser
- Authentication
- CORS
- Lucid ORM
- Migrations and seeds
Use the adonis command to install the blueprint
adonis new yardstick --api-only
or manually clone the repo and then run npm install
.
Run the following command to run startup migrations.
adonis migration:run