Created
May 22, 2018 04:00
-
-
Save d-neri/bee112e16ef907a47c758756b112c58e to your computer and use it in GitHub Desktop.
FeathersJS/Express/Swagger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const feathers = require('@feathersjs/feathers'); | |
const express = require('@feathersjs/express'); | |
const swagger = require('feathers-swagger'); | |
const app = express(feathers()); | |
// Turn on JSON body parsing for REST services | |
app.use(express.json()) | |
// Turn on URL-encoded body parsing for REST services | |
app.use(express.urlencoded({ extended: true })); | |
// Set up REST transport using Express | |
app.configure(express.rest()); | |
app.configure(swagger({ | |
docsPath: '/docs', | |
info: { | |
title: 'A test', | |
description: 'A description' | |
} | |
// Set up an error handler that gives us nicer errors | |
app.use(express.errorHandler()); | |
// Start the server on port 3030 | |
app.listen(3030); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment