Skip to content

Commit

Permalink
fix response headers #195
Browse files Browse the repository at this point in the history
  • Loading branch information
stepankuzmin committed Jan 30, 2018
1 parent 48cc255 commit 2c38fda
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 28 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,10 @@
## Changelog

### 5.15.1

- Rewrite using plain NodeJS
- Update to `osrm` [v5.15.1](https://github.com/Project-OSRM/osrm-backend/releases/tag/v5.15.1)

### 5.10.0

- Update to `osrm` [v5.10.0](https://github.com/Project-OSRM/osrm-backend/releases/tag/v5.10.0)
Expand Down
21 changes: 1 addition & 20 deletions README.md
Expand Up @@ -13,8 +13,6 @@ Lightweight Node.js isochrone server. Build isochrones using [OSRM](http://proje

## Installation

Galton requires node v7.6.0 or higher for ES2015 and async function support.

```
npm install -g galton
```
Expand All @@ -25,7 +23,6 @@ npm install -g galton
git clone https://github.com/urbica/galton.git
cd galton
npm install
npm run build
```

## Usage
Expand Down Expand Up @@ -76,22 +73,6 @@ Build isochrones for 10, 20 and 30 minute intervals
curl http://localhost:4000 --get --data 'lng=37.62&lat=55.75&intervals=10&intervals=20&&intervals=30'
```

Using Galton in your Node.js application

```js
const galton = require('galton');

const config = {
port: 4000,
osrm: 'moscow_russia.osrm'
}

const app = galton(config);
app.listen(config.port, () => {
console.log('Listening on %s', config.port);
});
```

See the [example](https://github.com/urbica/galton/blob/master/examples/index.html), [API](https://github.com/urbica/galton/blob/master/API.md) and `test/index.js` for more info.

## Using with Docker
Expand All @@ -114,7 +95,7 @@ docker run -d -p 4000:4000 urbica/galton "https://s3.amazonaws.com/metro-extract
curl http://localhost:4000 --get --data 'lng=37.62&lat=55.75'
```

You can also set `sysctl` options for container with `--sysctl`
You can also try setting `sysctl` options for container with `--sysctl`

```shell
docker run \
Expand Down
4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "galton",
"version": "5.14.2",
"version": "5.15.1",
"description": "lightweight isochrone server",
"author": "Stepan Kuzmin <to.stepan.kuzmin@gmail.com> (stepankuzmin.ru)",
"license": "MIT",
Expand All @@ -21,7 +21,7 @@
"dependencies": {
"isochrone": "^2.0.1",
"minimist": "^1.2.0",
"osrm": "5.14.2"
"osrm": "5.15.1"
},
"devDependencies": {
"@mapbox/geojsonhint": "^2.0.1",
Expand Down
8 changes: 6 additions & 2 deletions profiles/stepless.lua
Expand Up @@ -33,6 +33,7 @@ function setup()
'toll_booth',
'sally_port',
'gate',
'lift_gate',
'no',
'kerb',
'block'
Expand Down Expand Up @@ -236,10 +237,13 @@ function process_way(profile, way, result)
WayHandlers.startpoint,

-- set name, ref and pronunciation
WayHandlers.names
WayHandlers.names,

-- set weight properties of the way
WayHandlers.weights
}

WayHandlers.run(profile,way,result,data,handlers)
WayHandlers.run(profile, way, result, data, handlers)
end

function process_turn (profile, turn)
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -20,7 +20,7 @@ const galton = (config) => {
const { query } = url.parse(req.url, true);
const options = Object.assign({}, parseQuery(query), { osrm });

res.writeHead(200, { 'Content-Type': 'application/json' });
res.setHeader('Content-Type', 'application/json');
if (config.cors) {
res.setHeader('Access-Control-Allow-Origin', '*');
}
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Expand Up @@ -4179,9 +4179,9 @@ osenv@^0.1.4:
os-homedir "^1.0.0"
os-tmpdir "^1.0.0"

osrm@5.14.2:
version "5.14.2"
resolved "https://registry.yarnpkg.com/osrm/-/osrm-5.14.2.tgz#2bfe731800434a44d3bf94624f21161ca5df2781"
osrm@5.15.1:
version "5.15.1"
resolved "https://registry.yarnpkg.com/osrm/-/osrm-5.15.1.tgz#c6a2c190808e11854ccd031ca0ea1fa683ddf595"
dependencies:
nan "^2.6.2"
node-cmake "^2.3.2"
Expand Down

0 comments on commit 2c38fda

Please sign in to comment.