Skip to content
Snippets Groups Projects
Commit 79118b8c authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Change server.js to get PORT environment variable

parent 9d025dd0
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -27,10 +27,10 @@ app.use(cors())
app.use(methodOverride())
app.use(apicache('1 hour'))
app.use('/v1/', api)
app.use('/v1/states', states)
app.use('/v1/regions', regions)
app.use('/v1/cities', cities)
app.use('/api/v1/', api)
app.use('/api/v1/states', states)
app.use('/api/v1/regions', regions)
app.use('/api/v1/cities', cities)
// catch 404 and forward to error handler
app.use(function(req, res, next){
......
......@@ -5,9 +5,9 @@ var config = require(libs + 'config')
var log = require(libs + 'log')(module)
var app = require(libs + 'app')
app.set('port', config.get('port') || 3000)
app.set('port', process.env.PORT || config.get('port') || 3000)
var server = app.listen(app.get('port'), function() {
debug('Express server listening on port ' + server.address().port)
log.info('Express server listening on port ' + config.get('port'))
log.info('Express server listening on port ' + server.address().port)
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment