mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-09 01:56:05 -05:00
24 lines
549 B
JavaScript
24 lines
549 B
JavaScript
'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['/hello']) {
|
|
console.log('try this:\ncurl http://127.0.0.1:' + port + '/hello?name=Scott');
|
|
}
|
|
});
|