This project demonstrates a REST API with e-mail functionality using AdonisJS. It uses AdonisJS v4.1.
Run the command below to install dependencies
$ npm install
Duplicate .env.example
and rename it .env
To setup your database. Create a adomail.sqlite
file in the database folder.
To setup e-mail functionality you can create a Mailtrap account. From the Mailtrap settings you can copy the port, username and password.
Enter the following in .env
file
HOST=127.0.0.1
PORT=99
NODE_ENV=development
APP_NAME=Adomail
APP_URL=http://${HOST}:${PORT}
CACHE_VIEWS=false
APP_KEY=
DB_CONNECTION=sqlite
DB_DATABASE=adomail
HASH_DRIVER=bcrypt
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=
MAIL_PASSWORD=
Run this command to generate a key for the app.
$ adonis key:generate
Run the following command to run migration.
$ adonis migration:run
Seed the database:
$ adonis seed
Finally, start the application:
$ adonis serve --dev