forked from gseok/ksp-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
29 lines (25 loc) · 989 Bytes
/
server.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
26
27
28
29
var express = require('express'),
wikidb = require('./routes/wikidb');
var app = express();
app.configure(function () {
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "X-Requested-With");
next();
});
app.use(app.router);
});
app.post('/getDocument', wikidb.getDocument);
app.post('/createDocument', wikidb.createDocument);
app.post('/saveDocument', wikidb.saveDocument);
app.post('/getDocumentTree', wikidb.getDocumentTree);
app.post('/checkDocumentUrl', wikidb.checkDocumentUrl);
app.post('/deleteDocument', wikidb.deleteDocument);
app.post('/getDocumentHistory', wikidb.getDocumentHistory);
app.post('/renameDocument', wikidb.renameDocument);
app.post('/addUser', wikidb.addUser);
app.post('/searchDocument', wikidb.searchDocument);
app.listen(3000);
console.log('Listening on port 3000...');