Skip to content

Fix dual app bug #4

Open
Open

Description

@ericuldall

ExpressMVC should be able to run multiple app instances on different ports and/or ip's without issue, however there is currently an issue doing so. I believe this stems from the app configs being shared across EMVC globally. We need to make sure each app gets a unique version of express with it's own unique options.

Example:

var ExpressMVC = require('express_mvc');
var app_a = new ExpressMVC.App({port: 8080});
var app_b = new ExpressMVC.App({port: 8081});
var router = new ExpressMVC.Router('/');
router.addRoute(new router.Route('GET', '/', function(req, res){ res.write('test'); res.end();}));

app_a.addRouter(router);
app_b.addRouter(router);

app_a.listen();
app_b.listen();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions