Skip to content

Commit

Permalink
adds the hability to define custom routes through the faux object (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
olavoasantos committed Aug 30, 2018
1 parent fb92aef commit 7d18a50
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Faux.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const Config = require('./config');
const { Start, Register } = require('./main');
const { Start, Register, App } = require('./main');

module.exports = {
Start,
Config,
Register,
App,
};
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const { Config, Start, Register } = require('./Faux');
const { Config, Start, Register, App } = require('./Faux');

/** Base faux wrapper */
const faux = {
config: Config,
register: Register,
start: Start,
route: App,
}

module.exports = faux;
3 changes: 2 additions & 1 deletion main/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const Start = require('./Start');
const Register = require('./Register');
const App = require('../server');

module.exports = { Start, Register };
module.exports = { App, Start, Register };
4 changes: 4 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,9 @@ faux.config.set('auth.namespace', '/auth');
faux.register(UserModel);
faux.register(ProfileModel);

faux.route.get('/test', (req, res) => {
res.send('test');
});

// Start faux
faux.start(3000);

0 comments on commit 7d18a50

Please sign in to comment.