Coder Social home page Coder Social logo

hapi-cli's Introduction

CircleCI NPM Downloads Coverage Status Known Vulnerabilities Dependency Status devDependency Status License

Hapi-cli generator

Files structure

project/
├── app.js
├── config/
│   ├── default.json
│   └── production.json
├── controllers/
│   └── user.controller.js
├── models/
│   └── user.model.js
├── policies/
│   ├── admin.policy.js
│   └── default.policy.js
├── routes/
│   ├── base.route.js
│   └── user.route.js
└── services/
    ├── utils/
    │   ├── db.js
    │   └── utils.js
    └── hashPassword.service.js

Installation

npm install -g hapi-starter

Create project

hapi-cli new [project-name]

cd [project-name]

npm start

Create model

hapi-cli generate model [name] [options]

Options

--properties | -p : List of properties of your entitie. (format: [name]:[type])

Examples

hapi-cli generate model room --properties size:number,name:string

Create controller

hapi-cli generate controller [name] [options]

Options

--methods | -m : List of methods for your controller (default: create,remove,find,update )

Examples

hapi-cli generate controller room
hapi-cli generate controller room --methods create,remove

Create Route

hapi-cli generate route [name] [options]

Options

--verbs | -v : List of endpoints for your route (default: get,post,delete,put )
--controller | -c : Name of controller. (default: file's name )

Examples

hapi-cli generate route room
hapi-cli generate route room --verbs get,post

Create API

hapi-cli generate api [name] [options]

Options

--verbs | -v : List of endpoints for your route (default: get,post,delete,put )
--controller | -c : Name of controller. (default: file's name )
--methods | -m : List of methods for your controller (default: create,remove,find,update )
--properties | -p : List of properties of your entitie. (format: [name]:[type])

Example

hapi-cli generate api owner

project

TODO

If you'd like the cli to do something that it doesn't do or want to report a bug please use the github issue tracker on github

fork / patches / pull requests

You are very welcome to send patches or pull requests

hapi-cli's People

Contributors

amoreaux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

hapi-cli's Issues

Documentation on the generated code

It would be helpful to get a brief flyby on the README describing the file structure and how the app does certain actions like authentication. If you're still maintaining the repo :)

while starting the dev env i am getting this issue follows bellow

yarn run v1.9.4
$ node app.js
Connection DB ok mongodb://localhost/wallet
{ Error: getaddrinfo ENOTFOUND 3000
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)
errno: 'ENOTFOUND',
code: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: '3000' }
I think this because of url address but i don't know to solve it

`npm install` Fails

The script is asking to use bcrypt >=v2.0.0. Also the download of files from v1.0.3 returns 404

npm WARN deprecated [email protected]: bcrypt < v2.0.0 is susceptible to bcrypt wrap-around bug. Upgrade to bcrypt >= v2.0.0 for improved support for newer bcrypt hashes

> [email protected] install /media/sisir/vms/cloud-spaces/Dropbox/Sisir-Workspace/projects-node/adligence-rest/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.3/bcrypt_lib-v1.0.3-node-v64-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp) 
node-pre-gyp ERR! Tried to download(undefined): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.3/bcrypt_lib-v1.0.3-node-v64-linux-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI) (falling back to source compile with node-gyp) 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.