git clone https://github.com/eseom/hails-sample <project name>
cd <project name>
docker-compose up -d
yarn
yarn hails db:up
yarn dev
open http://localhost:3000
# db migration
yarn hails db:create -- --name <new migration name>
yarn hails db:up
yarn hails db:down
# custom commands
yarn hails test_command
# see ./src/core/command.js
export default {
context: undefined,
vesion: undefined,
connection: {
host: '0.0.0.0',
port: 3000,
},
logger: {
level: 'silly',
},
modules: [],
moduleFilenames: ['api', 'app', 'method', 'view', 'task'],
modelFilenames: ['model'],
useSequelize: false,
viewEngine: {
type: 'nunjucks',
},
scheduler: {
enable: false,
},
swagger: {
info: {
title: 'API Documentation',
},
grouping: 'tags',
},
yar: {
engine: {
type: 'memory',
},
cookieOptions: {
password: 'the-password-must-be-at-least-32-characters-long',
isSecure: false,
},
},
}
src
├── core
│ ├── app.js
│ ├── api.js
│ ├── task.js
│ ├── model.js
│ ├── templates
│ │ ├── base.html
│ │ └── index.html
│ └── view.js