我已经用咖啡写了一个节点restify服务器,我似乎无法让它运行.
部署时我收到以下错误:
等待应用程序端口(8080)变得可用...
之后我得到以下错误
应用程序'appname'无法启动(端口8080不可用)
如果coffeescript似乎是问题,那么就有一项工作.我不想改回js.
我的服务器代码是:
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
Run Code Online (Sandbox Code Playgroud) 我事先意识到这是一个模糊的问题,但我很难过我还能在这里尝试什么......
我一直在经历其他SO问题并遵循他们的建议但到目前为止还没有解决我的问题.
这是我得到的具体错误.
Stopping NodeJS cartridge
Fri Jul 10 2015 10:36:28 GMT-0400 (EDT): Stopping application 'appname' ...
Fri Jul 10 2015 10:36:29 GMT-0400 (EDT): Stopped Node application 'appname'
Starting NodeJS cartridge
Fri Jul 10 2015 10:36:30 GMT-0400 (EDT): Starting application 'appname' ...
Waiting for application port (8080) become available ...
Application 'appname' failed to start (port 8080 not available)
Failed to execute: 'control restart' for /var/lib/openshift/MYID/nodejs
Run Code Online (Sandbox Code Playgroud)
我的package.json文件是最新的所有我的依赖项,有scripts: { start: 'node server.js' }属性,但我仍然收到此错误.
如果我SSH并进入我的current/repo目录并运行node …