Skip to content

Commit

Permalink
cleanup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Mar 22, 2019
1 parent bd62131 commit cb6a67f
Show file tree
Hide file tree
Showing 11 changed files with 207 additions and 261 deletions.
12 changes: 10 additions & 2 deletions example/app.js
Expand Up @@ -4,7 +4,7 @@ var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var logger = require('morgan');
var http = require('http');
var OpenApiMiddleware = require('../').OpenApiMiddleware;
var OpenApiMiddleware = require('express-middleware-openapi').OpenApiMiddleware;
var app = express();

app.use(bodyParser.json());
Expand All @@ -15,7 +15,7 @@ app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));

new OpenApiMiddleware({
apiSpecPath: './openapi.yaml',
apiSpecPath: '../openapi.yaml',
validateApiDoc: true, // the default
enableObjectCoercion: true, // the default
}).install(app);
Expand All @@ -37,6 +37,14 @@ app.get('/v1/pets/:id', function(req, res, next) {
});
});

app.get('/v1/pets/:id/attributes', function(req, res, next) {
res.json({
id: req.params.id,
name: 'sparky',
});
});


var server = http.createServer(app);
server.listen(3000);
console.log('Listening on port 3000');
Expand Down
165 changes: 0 additions & 165 deletions example/openapi.yaml

This file was deleted.

0 comments on commit cb6a67f

Please sign in to comment.