forked from cBioPortal/ctmole
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
29 lines (20 loc) · 788 Bytes
/
app.js
File metadata and controls
29 lines (20 loc) · 788 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 SwaggerExpress = require('swagger-express-mw');
var app = require('express')();
module.exports = app; // for testing
var config = {
appRoot: __dirname // required config
};
SwaggerExpress.create(config, function(err, swaggerExpress) {
if (err) { throw err; }
// install middleware
swaggerExpress.register(app);
var port = process.env.PORT || 10010;
app.listen(port);
if (swaggerExpress.runner.swagger.paths['/trialsByMutations']) {
console.log('try this:\ncurl http://localhost:10010/trialsByMutations?gene=braf&alteration=fusion,v600k');
}
if (swaggerExpress.runner.swagger.paths['/trialsByCancersMutations']) {
console.log('try this:\ncurl http://localhost:10010/trialsByCancersMutations?gene=braf&alteration=fusion,v600k');
}
});