我有以下代码
//Start.js
var file1 = require('./file1.js'),
file2 = require('./file2.js'),
connectDomain = require('connect-domain'),
connectRoute = require('connect-route'),
connect = require('connect'),
app = connect();
app.use(connectDomain()) // For error handling
.use(connectRoute(function (router) {
router.get('/', function (req, res, next) {
file1.writeFile(req, res); // Writing the file and storing in DB
file2.readAllFiles(req,res); // Reading the file from DB
})
}))
app.listen(1000);