-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
25 lines (22 loc) · 870 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var logger = require("./logger.js");
var express = require("express");
//testing out express
var app = express();
//logging every request
app.use(function (req, res, next) {
var method = req.method;
var path = req.path;
// var query = req.query;
logger.log(method + "\t" + path + "\n");
console.log(method + "\t" + path + "\n");
next();
});
app.get('/index.html', require("./indexcontroller.js").indexc);
app.get('/', require("./indexcontroller.js").indexc);
app.get('/student', require("./studentcontroller.js").student);
app.post('/index.html', require("./indexcontroller.js").indexc);
app.post('/', require("./indexcontroller.js").indexc);
app.post('/student', require("./studentcontroller.js").student);
server = app.listen(8080, function () {
console.log("listening on " + server.address().address + ":" + server.address().port);
});