Folks, следующие зависания при вызове http://localhost:3000/file/sync
CoffeeScript требуется модуль висит
app.coffee:
express = require('express')
jsonFun = require('./jsonFun')
app = express()
exports.app = app
app.configure() ->
app.set 'view engine', 'jade'
app.use express.bodyParser()
app.use express.logger('dev')
app.use app.router
app.get '/hello/:name', (req, res) ->
res.send 'hello ' + req.params.name
app.get '/file/sync', (req, res) ->
jsonFun.syncJSON
app.listen 3000
console.log "Listening on 3000..."
jsonFun.coffee:
fs = require 'fs'
module.exports.syncJSON = ->
console.log 'syncJSON Called'
res.send 'json file results ' + req
module.exports.asyncJSON = ->
console.log 'asyncJSON Called'
Что бы правильный синтаксис для включения файл jsonFun.coffee, и передать по req, res и вернуть ответы? Благодаря!
Почему нижний предел? – Cmag