I have written a node restify server in coffee and I can't seem to get it running.
While deploying I get the following error:
Waiting for application port (8080) become available ...
after which I do get the following error
Application 'appname' failed to start (port 8080 not available)
If coffeescript seems to be the problem is there a work around it. I would not want to change back to js.
My server code is:
restify = require 'restify'
Bunyan = require 'bunyan'
server = restify.createServer
name: 'APPNAME'
version: '0.0.1'
log: Bunyan.createLogger
name: 'api'
serializers:
req: ()->
return "bad"
# Usercontroller.access calls a function to process the request
server.post '/user/access', UserController.access
server = create.createServer()
server.listen server_port, ->
console.log "Http server listening on #{server_port}"
require('./document')(server.router.mounts, 'restify')
return
process.env.OPENSHIFT_NODEJS_PORT
as your port. – Incursiveserver_port = process.env.OPENSHIFT_NODEJS_PORT || 8080 server_ip_address = process.env.OPENSHIFT_NODEJS_IP || '127.0.0.1'
– Moistenconfig = require 'cloud-env'
and using `server.listen config.PORT, config.IP, ()->' but still getting the same error – Moistenprocess.env.OPENSHIFT_NODEJS_PORT
is not defined and therefore relying on 8080. tryconsole.log process.env
to check where openshift is setting the port – Incursive