hails
TypeScript icon, indicating that this package has built-in type declarations

0.5.9 • Public • Published

hails

hapi based web stack with sequelize, kuejs, etc.

  • from 0.4.0, added supports for hapi17

npm version

get started

mkdir my-project
cd $_
yarn add hails
mkdir -p src/core
 
# settings.js 
echo "module.exports = {
  development: {
    context: './src',
    modules: [
      'core',
    ],
  },
}" > settings.js
 
# src/core/api.js 
echo "export default () => [{
  method: 'GET',
  path: '/',
  handler(request) {
    return 'hello world'
  },
}]" > src/core/api.js
 
# that's all, run a server. 
yarn hails run
# open http://localhost:3000 

sample code

git clone https://github.com/eseom/hails-sample <project name>
cd <project name>
yarn
yarn dev

feature

  • essential hapi plugins
  • module system like django
  • sequelize integrated
  • kue integrated

default options

export default {
  context: undefined,
  vesion: undefined,
  server: {
    host: 'localhost',
    port: 3000,
  },
  logger: {
    level: 'silly',
  },
  modules: [],
  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,
    },
  },
}

development

yarn
yarn watch

api

  • (TODO)

Readme

Keywords

none

Package Sidebar

Install

npm i hails

Weekly Downloads

3

Version

0.5.9

License

MIT

Unpacked Size

237 kB

Total Files

59

Last publish

Collaborators

  • eseom