Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eseom/hails-sample
https://github.com/eseom/hails-sample
Last synced: 12 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/eseom/hails-sample
- Owner: eseom
- Created: 2017-04-23T14:52:19.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-13T04:54:16.000Z (almost 7 years ago)
- Last Synced: 2024-11-01T05:26:46.218Z (2 months ago)
- Language: JavaScript
- Size: 114 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hails-sample
- hails: advanced web stack with hapijs, sequelize, kuejs# features
- es7 (include import without any configurations)
- django module style
- eslint
- hapi-swagger# required
- node >= 8.9.0
- redis# usage
```
git clone https://github.com/eseom/hails-sample
cd
docker-compose up -d
yarn
yarn hails db:up
yarn dev
open http://localhost:3000# db migration
yarn hails db:create -- --name
yarn hails db:up
yarn hails db:down# custom commands
yarn hails test_command
# see ./src/core/command.js
```# files idiom
- app.js: tools for the module (eg. redis client)
- api.js: restful apis
- view.js: endpoint for webbrowser with templates
- task.js: kuejs jobs queue with redis
- model.js: sequelize models# default-options
```
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,
},
},
}
```- you can override this settings with /settings.js
# sample project's files structure
```
src
├── core
│ ├── app.js
│ ├── api.js
│ ├── task.js
│ ├── model.js
│ ├── templates
│ │ ├── base.html
│ │ └── index.html
│ └── view.js
```