Fake implementations of your favourite Webmaker servers and APIs
Fake implementations of all your favourite Webmaker servers and APIs, including:
Webfaker is meant to aid in developing Webmaker code that depends on any/all of these services. It can be used as a library or started via the command-line.
$ npm install -g webfaker
$ webfaker...Started Webfaker services on ports: FakeAPI=10000, Fogin=10001, Fubble=10002
This will start all 3 servers on ports 10000 (MakeAPI), 10001 (Login), and 10002 (Hubble). You can use another series of ports by specifing a port in the command line. Other optional command line arguments include:
$ webfaker --port 5000 --fakes 1000 --username someone --password supersecret --email email@example.com --admincheck false
port- the first of 3 ports to use for the servers
fakes- the number of fake records to insert into FakeAPI. NOTE: this will also cause matching fake Login accounts to get created.
username- username to use for basic auth between servers
password- password to use for basic auth between servers
webfakersubdomain and the given email.
admincheck- whether or not to skip doing user lookup and admin checks for the
isAdminroute in the login server. This is useful if you need to fake admin users (defaults to true)
The command line version uses a module to control the servers, which you can use as well. This is useful if you want to programmatically access the servers to start and stop them in testing or the like.
var Webfaker = require"webfaker";Webfakerstart// First of 3 ports to use for the 3 serversport: 5000// HTTP basic auth credentials to use for all serversusername: "username"password: "password"// Number of fake makes to createfakes: 500// Extra fake logins to create in the login serverlogins:email: "firstname.lastname@example.org"subdomain: "admin"fullName: "An Admin"isAdmin: true// Whether or not to do user lookup and admin checks in the isAdmin routeisAdminCheck: falseconsole.log "Started Webfaker services on ports: FakeAPI=%s, Fogin=%s, Fubble=%s"port port + 1 port + 2 ;;// do some things...Webfakerstop ;