-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathapp.js
28 lines (22 loc) · 871 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const feathers = require('@feathersjs/feathers');
const express = require('@feathersjs/express');
const rest = require('@feathersjs/express/rest');
const errorHandler = require('@feathersjs/express/errors');
const bodyParser = require('body-parser');
const services = require('./services');
// Create a feathers instance.
const app = express(feathers())
// Enable REST services
.configure(rest())
// Turn on JSON parser for REST services
.use(bodyParser.json())
// Turn on URL-encoded parser for REST services
.use(bodyParser.urlencoded({ extended: true }));
app.set('kong', { url: 'http://localhost:8001' });
// Set up our services (see `services/index.js`)
app.configure(services);
// Handle Errors
app.use(errorHandler());
// Start the server
module.exports = app.listen(3030);
console.log('Feathers Todo Objection service running on 127.0.0.1:3030');