arma-server-web-admin/main.js

28 lines
733 B
JavaScript
Raw Normal View History

2014-02-09 03:19:48 +00:00
var express = require('express'),
2014-04-04 08:37:43 +00:00
Resource = require('express-resource');
2014-02-09 03:19:48 +00:00
2014-04-04 08:37:43 +00:00
var config = require('./config');
2014-02-09 03:19:48 +00:00
var app = express();
app.use(express.logger('dev'));
app.use(express.cookieParser());
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express.static(__dirname + '/public'));
2014-04-06 21:09:52 +00:00
var servers = require('./routes/servers');
2014-04-04 08:37:43 +00:00
app.resource('api/missions', require('./routes/missions'));
app.resource('api/mods', require('./routes/mods'));
2014-04-06 21:09:52 +00:00
app.resource('api/servers', servers);
2014-04-04 08:37:43 +00:00
app.resource('api/settings', require('./routes/settings'));
2014-02-13 22:47:51 +00:00
2014-04-06 21:09:52 +00:00
app.get('/api/servers/:server/start', servers.start);
2014-02-09 03:19:48 +00:00
2014-04-04 08:37:43 +00:00
app.get('/', function (req, res){
2014-02-09 03:19:48 +00:00
res.sendfile(__dirname + '/public/index.html');
});
app.listen(3000);