-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
26 lines (20 loc) · 700 Bytes
/
server.js
File metadata and controls
26 lines (20 loc) · 700 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
'use strict';
var Restify = require('restify');
var Swaggerize = require('swaggerize-restify');
var Path = require('path');
var Server = Restify.createServer();
Server.use(Restify.bodyParser());
Server.use(Restify.queryParser());
Server.get('/api', function (req, res) {
res.send(200);
});
Swaggerize(Server, {
api: Path.resolve('./config/swagger.json'),
handlers: Path.resolve('./handlers')
});
Server.listen(8000, function () {
Server.swagger.api.host = Server.address().address + ':' + Server.address().port;
/* eslint-disable no-console */
console.log('App running on %s:%d', Server.address().address, Server.address().port);
/* eslint-disable no-console */
});