An open API service indexing awesome lists of open source software.

https://github.com/vicainelli/node-scaffold-api-adonisjs


https://github.com/vicainelli/node-scaffold-api-adonisjs

adonis adonis-framework adonisjs adonisjs-framework adonisjs5 api microservice node-api node-api-base rest-api scaffold-template

Last synced: 3 months ago
JSON representation

Awesome Lists containing this project

README

        

# NodeJS Scaffold API with AdonisJS 5

## Requirements

- Node.js >= `14.15.4`
- npm >= `6.0.0`

And if you don't have a database installed, you can use the Docker container.

## Set It Up

### Install node dependencies
```
npm install
```

### Create the .env file
```
cp .env.example .env
```

### Create the tmp directory

> This step is necessary only to run tests

```
mkdir -p tmp
```

### Add the Docker database variables

> Only if you are going to use the database from the Docker container.

```
DB_CONNECTION=mysql
MYSQL_HOST=localhost
MYSQL_PORT=3307
MYSQL_USER=adonisjs
MYSQL_PASSWORD=secret
MYSQL_DB_NAME=adonisjs
MYSQL_ALLOW_EMPTY_PASSWORD=true
```

### Set up docker
```
docker-compose build && docker-compose up -d
```

### Run the migrations
```
node ace migrations:run
```

### Start and watch the serve
```
node ace serve --watch
```