This folder contains an AWS lambda script which pretends to be a Pelias endpoint. It will forward any request it receives to both Geocode.earth (using the API key in env.yml
) and a custom Pelias instance (defined in env.yml
). It will merge the responses together seamlessly. The client will think it's communicating only with a regular Pelias server.
If you enable the offline geocoder, POIs are loaded in through pois.json
in the root directory. The format is a raw array []
.
Local running is done via the offline serverless plugin. The plugin will automatically build the TypeScript and start a server. Create an env.yml
file based on the example file provided.
Serverless starts the lambda function server on port 3000
.
The endpoint is then accessible under http://localhost:3000/dev
(either search or autocomplete)
yarn start
Testing is done via Jest.
yarn test
will build the TypeScript and run the tests
Ensure the env.yml file is present and contains the keys given in the example file.
Deployment is done via Serverless using AWS keys stored on the computer.
serverless deploy [--aws-profile [name-of-profile]]