json-mock-hapi

0.0.7 • Public • Published

README

This Repository contains JSON Mock HAPI Server sources This Server uses the library HAPI.

Requirements

  • install node js,

  • clone the project,

  • type the command:

      npm install
    

    (this will install other required libraries.)

Compile the projet

type the command:

gulp

(Sources are written in ES6 and are "transpiled" with babel)

Unit tests

Unit tests are made with mocha. Tests are located in "test" folder.

Requirements

install mocha:

npm install -g mocha
npm install mocha-traceur --save-dev  

Run tests:

mocha --compilers js:mocha-traceur      

Start the server

node start 

This has the effect to start the mock using port 3000 and the folder "./api" for services configuration.

  • start the server by specifying the port:

    node start -p 3000
    
  • start the server by specifying the services configuration folder:

    node start -f './services-definition'
    
  • start the server and listen changes in the configuration folder:

    node start -w
    
  • list all available arguments:

    node start --help
    
  • complete sample:

    node start -p 3000 -f './api' -w
    

using the server

  • try this command :

    node start -p 3000 -f './test' -w
    
  • then, try this url in your navigator :

    http://localhost:3000/hello-world   
    
  • see "test" folder to find sample service configurations.

Readme

Keywords

none

Package Sidebar

Install

npm i json-mock-hapi

Weekly Downloads

6

Version

0.0.7

License

MIT

Last publish

Collaborators

  • eferte