Skip to content
forked from Iragne/MockMe

Create easay mock url for express or file baed on model

License

Notifications You must be signed in to change notification settings

Quimoune/MockMe

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MockMe

Build Status

Create easy mock url for express or file based on model

Install

npm install mock-me

Run

node index.js -m ./api/models.js -a ./api/actions.js -p 8080

node index.js --help
Usage: index [options] [arguments]

Mock Me. the mock generator

 Arguments:
  arg                         Sample argument

 Options:
  -a, --actions=/path         Path for actions file
  -m, --models=/path          Path for models file
  -o, --out=/path             Path for output mock file
  -c, --out-model=/path       Path for output model files
  -p, --port= 8080            Server Mock port
  -h, --help                  Display this help message and exit
  -v, --version               Output version information and exit

Report bugs to <admin@jast-io.com>.

Create your Model

example in api/models.js

var User = module.exports.User = function (){
    return {
		user_id:getSequence("users"),
		user_login:"TestUser",
		user_valide:1,
		user_email:"test@test.com",
		Messages:getArray("Message",10)
	};
};

Create your Action

modules:[
    	{
			name:"User",
			path:"/api/0.1/:key/",
			actions:[
				{
					name:"user",
					uri:"users/:mrlid",
					output:{
						User:"User"
					}
				},
			]
		},
	]

About

Create easay mock url for express or file baed on model

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • CSS 50.1%
  • JavaScript 49.9%