Nicolas Massé 8 years ago
parent
commit
0ff1ec614a
  1. 25
      openapi-spec.yaml
  2. 19
      server.js

25
openapi-spec.yaml

@ -3,23 +3,28 @@ swagger: 2.0
info:
title: Summit API
description: An API that gives information about the Red Hat Summit.
version: 2.0.0
version: 1.0.0
paths:
/location:
get:
summary: Get Next RH Summit Location
description: 'Get the location of the next RedHat Summit '
operationId: GetLocation
x-threescale-smoketests-operation: true
responses:
200:
description: OK
security:
- oidc:
- openid
/timeframe:
get:
summary: Get Next RH Summit Timeframe
description: Get the timeframe of the next RedHat Summit.
operationId: GetTimeframe
responses:
200:
description: OK
securityDefinitions:
oidc:
type: oauth2
flow: accessCode
scopes:
openid: Get an OpenID Connect token
apikey:
name: api-key
in: header
type: apiKey
security:
- apikey: []

19
server.js

@ -8,10 +8,6 @@ router.use(function (req,res,next) {
console.log("%s %s => %i", req.method, req.originalUrl, res.statusCode);
});
router.get("/",function(req,res){
res.sendFile(__dirname + '/views/index.html');
});
router.get("/location", function(req, res) {
var response = { "Location": "SFO" };
res.type('application/json')
@ -19,6 +15,21 @@ router.get("/location",function(req,res){
.end();
});
router.get("/timeframe",function(req, res) {
var response = { "From": "08/05/2018", "To": "10/05/2018" };
res.type('application/json')
.send(JSON.stringify(response))
.end();
});
/*
router.get("/participants",function(req, res) {
var response = [ "Mark", "Nicolas" ];
res.type('application/json')
.send(JSON.stringify(response))
.end();
});
*/
app.use("/",router);

Loading…
Cancel
Save