Skip to content

Instantly share code, notes, and snippets.

@d-neri
Created May 22, 2018 04:00
Show Gist options
  • Save d-neri/bee112e16ef907a47c758756b112c58e to your computer and use it in GitHub Desktop.
Save d-neri/bee112e16ef907a47c758756b112c58e to your computer and use it in GitHub Desktop.
FeathersJS/Express/Swagger
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