-
Notifications
You must be signed in to change notification settings - Fork 1
/
server.js
39 lines (28 loc) · 863 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
30
31
32
33
34
35
36
37
38
39
var requirejs = require('requirejs'),
http = require('http'),
jade = require('jade'),
express = require('express'),
fs = require("fs");
// Boiler plate stuff - as per r.js's instructions
requirejs.config({ nodeRequire: require });
var ClientTask = null;
requirejs(["./models/client/task"], function(task) {
ClientTask = task;
});
var Task = null;
requirejs(["./models/server/task"], function(task) {
Task = task;
Task.prototype = new ClientTask();
});
app = express.createServer();
app.get('/', function(req, res) {
var task = new Task();
// Both method should work
task.create();
task.DBconnect();
res.render('index.jade');
});
app.use("/scripts", express.static(__dirname + '/scripts'));
app.use("/scripts/models", express.static(__dirname + '/models/client'));
app.listen('7777');
console.log('Up and running.');