Looks in the file system assigns the proper port number to a project.
npm install dynamic-port``
var dynamicPort = require('dynamic-port');
dynamicPort(function(port) {
app.listen(port, function() {
console.log('Listening on port ' + port);
});
});
`
.The
deployment.json file provides Mizer Sites with port numbers for the different dev site environments along with Git branch names and other information listed below.
`json
{
"name": "my new site",
// name of the project
"environments" : [{
// array of environments for a dev site
"type": "env/dev",
// environment type †
"portNumber": 3013
// port number assigned to this environemt
},
{
// array of environments for a uat site
"type": "env/uat",
// environment type †
"portNumber": 3014
// port number assigned to this environemt
}]
}
`
† The "type" value corresponds to the Git branch name for a particular environment.Port Determination
Corresponding to the
type value listed in the environments` array, the port will be"env/dev" is the default when no match exists (works best for local dev'ing).