Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/city-of-helsinki/paatokset-elastic-proxy
Node.js proxy for elastic search
https://github.com/city-of-helsinki/paatokset-elastic-proxy
Last synced: about 2 months ago
JSON representation
Node.js proxy for elastic search
- Host: GitHub
- URL: https://github.com/city-of-helsinki/paatokset-elastic-proxy
- Owner: City-of-Helsinki
- Created: 2021-12-09T09:13:51.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T10:24:25.000Z (about 1 year ago)
- Last Synced: 2024-04-08T16:42:44.492Z (9 months ago)
- Language: JavaScript
- Size: 91.8 KB
- Stars: 0
- Watchers: 2
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Paatokset Elastic proxy
This is a Node.js application for proxying requests to Elasticsearch server. Built with Express.js.
### Getting started
```console
foo@bar:~$ npm i
foo@bar:~$ npm run dev
```If your Elastic is not running in localhost:9200, you may set the url with `ELASTIC_URL` env variable.
If you wish for this application to run in a port ohther than `3000`, you may set the port with `PORT `env variable.
### How it works
This application proxies requests from a frontend application to Elasticsearch backend. In this manner we don't need to make Elastic server publicly accessible.For simplicity's sake, this application exposes only 3 endpoints:
```
/ping
/_search
/_msearch
````/ping` is used to verify that the proxy is alive. Other 2 endpoints proxy request as is to Elastic backend. Read Elastic docs regarding these endpoints to determine how they work.