-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
27 lines (23 loc) · 671 Bytes
/
app.js
File metadata and controls
27 lines (23 loc) · 671 Bytes
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
var restify = require('restify'),
bunyan = require('bunyan'),
server = restify.createServer({
name: 'oauth-proxy'
}),
memory = require('./plugins/memory')
server.pre(restify.pre.userAgentConnection());
server.use(restify.acceptParser(server.acceptable));
server.use(restify.CORS());
server.use(restify.gzipResponse());
server.use(restify.conditionalRequest());
server.use(restify.queryParser());
server.use(restify.requestLogger())
server.get(/\/public\/?.*/, restify.serveStatic({
directory: './static',
default: 'index.html'
}))
server.get('/', function(req, res, next) {
res.header('Location', '/public/')
res.send(301)
next()
})
module.exports = server