-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.js
40 lines (33 loc) · 860 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var express = require('express'),
http = require('http'),
path = require('path');
var app = express(),
server = http.createServer(app),
io = require('socket.io')(server);
var Artbot = require('./artbot')(io);
app.configure(function(){
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname));
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(app.router);
app.use(express.static(path.join(__dirname)));
});
app.configure('development', function(){
app.use(express.errorHandler());
});
app.get('/', function (req, res) {
res.render('artbot', {
title: 'Canvas Drawing',
next: '/move',
robot: false
});
});
app.get('/move', function (req, res) {
res.render('artbot', {
title: 'Artie the ArtBot',
prev: '/',
robot: true
});
});
server.listen(3000);