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
git clone https://github.com/denisluciano30/AirGarageAPI
npm i -g @adonisjs/cli
npm install
https://support.rackspace.com/how-to/install-mysql-server-on-the-ubuntu-operating-system/
sudo apt-get update
sudo apt-get install mysql-server
The installer installs MySQL and all dependencies.
If the secure installation utility does not launch automatically after the installation completes, enter the following command:
sudo mysql_secure_installation utility
After the installation is complete, you can start the database service by running the following command. If the service is already started, a message informs you that the service is already running:
sudo systemctl start mysql
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'
Where root as your user localhost as your URL and password as your password
Then run this query to refresh privileges:
flush privileges;
mysql -u root -p
CREATE DATABASE airgaragedb;
copy file .env.example and rename to .env and replace keys
cp .env.example .env
adonis key:generate
adonis migration:run
adonis serve --dev