How to use the @feathersjs/express.Router function in @feathersjs/express

To help you get started, we’ve selected a few @feathersjs/express examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nesterow / frontless / src / server.js View on Github external
import express from '@feathersjs/express'
import socketio from '@feathersjs/socketio'
import authentication from '@feathersjs/authentication'
import local from '@feathersjs/authentication-local'
import session from 'express-session'
import cors from 'cors'


import services from './api';
import routes from './routes'
import Html from './pages/Layout.jsx'

const api = feathers()
const app = express(api)

const router = express.Router()
const renderer = ssr({ 
  debug: true,
  routes,
  Html
})

const sessionMiddleware = session({
  secret: process.env.HTTP_SESSION_SECRET,
  resave: false,
  saveUninitialized: true,
  cookie: {secure: process.env.HTTP_SESSION_SECURE === 'yes'},
})

const corsMiddleware = cors({
  origin: '*',
})