GitXplorerGitXplorer
R

mockServerNode

public
1 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
7655eb76915e1c6116a37871fad5a8890f88df6c

modified showHelp in update endpoints

committed 9 years ago
Unverified
ea538914525e94c2b2435885f3409927d871cc16

added checkSession & set compress to server responses

committed 9 years ago
Unverified
8d7c7be388c2a1c61c7ac6919087338c52bc4146

'next' value change to index not url

committed 9 years ago
Unverified
9d76d90506a24a5f999c0746fc91e11250bd5107

server response file index bug fixed

committed 9 years ago
Unverified
1b805aa6e62338c41d6340cb99d3de8aa6f733b9

server local ip & bug jsonGenerator fixed

committed 9 years ago
Unverified
ff04cf6c8f27393e428a4b1783ef6882d52606d5

modified gitignore

committed 9 years ago

README

The README file for this repository.

mockServerNode

mock server implemented in NodeJs to develop mobile apps with server requests

many times when we develop mobile apps with back-end server side, we always have to wait for them to start implement our requests or while testing other developers could change CMS status and disturb ourselves. With a local mock server we could simulate back-end and change fake responses "in hot"

##enviroment install NodeJs from https://nodejs.org/en/

update project packages with Node Package Manager: $ npm update --save

##create new end point into app.js in root, add server endpoint by JSON configuration:

var serverUtils = require('./server/base/serverUtils.js') serverUtils.addServerEndpoint(configuration);

####configure json:

	serverUtils.addServerEndpoint({
		"name": SERVER_NAME,
		"server": {
			"method": GET/POST/PUT/DELETE,
			"endpoint": /ENDPOINT
		},		
		"response": {
			"type": RESPONSE_TYPE
		}
	});
  • SERVER_NAME will be your server path and name
  • ENDPOINT is the '/' char followed by the name of the endpoint of your server. It will be your response file name too.

Add response file to indicated path 'SERVER_NAME/ENDPOINT.extension'

####create endpoint services .js

TO-DO

Please put custom endpoints and related responses into same directory.