Skip to content

Commit 9004f92

Browse files
committed
readme and package update
1 parent e50836a commit 9004f92

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A complete solution of pgRouting direction Web API written in Node js (Javascrip
44

55
## Setup
66

7-
- edit `src/config/config.js` file according to your postgres connection, pgRouting table name and express js settings.
7+
- edit `.env` file according to your postgres connection, pgRouting table name and express js settings.
88

99
- *if your pgrouting database table schema/name of columns is different, you have to change the query schema in `src/model/pgrouting.js`
1010

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"license": "MIT",
2222
"dependencies": {
23+
"body-parser": "^1.19.0",
2324
"cors": "^2.8.5",
2425
"express": "^4.17.1",
2526
"fb-watchman": "^2.0.1",

server.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const express = require('express');
22
const cors = require('cors');
3+
const bodyParser = require("body-parser");
34
const {route, closest, distance} = require('./src/pgRouting');
45
const { exp_config } = require('./src/config');
56

@@ -12,11 +13,8 @@ const { exp_config } = require('./src/config');
1213

1314
const app = express();
1415
// const compiler = webpack(config);
15-
app.use(cors({
16-
origin: (origin, callback) => {
17-
callback(null, true);
18-
},
19-
}));
16+
app.use(cors());
17+
app.use(bodyParser.json());
2018

2119
// use nodemon no need to use webpack-hot-middleware and webpackDevMiddleware for express
2220
// app.use(webpackDevMiddleware(compiler, {

0 commit comments

Comments
 (0)