Tag: expressURL

一个调查网站,Node.js数据收集anamoly上heroku

我正在一个包含表单的网站上工作。 我的要求是收集每个用户的所有表单数据。 它是一个资金紧张的学术项目,因此我使用了heroku免费服务器空间。 我select了node.jsexpression式框架。 创build一个简单的表单,并在提交时,它写入一个json的文件。 以下是代码。 //require the express nodejs module var express = require('express'), //set an instance of exress app = express(), //require the body-parser nodejs module bodyParser = require('body-parser'), //require the path nodejs module path = require("path"); var fs = require("fs"); //support parsing of application/json type post data app.use(bodyParser.json()); //support parsing of application/x-www-form-urlencoded […]