1.4.0 • Published 5 years ago

@suddenly/server v1.4.0

Weekly downloads
8
License
ISC
Repository
github
Last release
5 years ago

@suddenly/server

Some handy helpers for Express apps.

Usage

Create a server with bodyParser, CORS, Helmet, and EJS views already applied.

Create a router with subrouters and an error handler already set up.

import { createServer, createRoutes } from '@suddenly/server';

const server = createServer({ views: 'src/server/views' });
server.use(
  createRouter(
    {
      '/api': {
        '/users': Users,
        '/things': Things
      },
      '/': Root
    } /* , override the error handler by passing a function here */
  )
);

server.listen(5000, () => {
  console.log('Listening at http://localhost:5000');
});

Contributors

1.4.0

5 years ago

1.3.1

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1

5 years ago