https://github.com/marconi1992/algolite
An Implementation of Algolia to emulate its REST API
https://github.com/marconi1992/algolite
algolia local-development
Last synced: 4 months ago
JSON representation
An Implementation of Algolia to emulate its REST API
- Host: GitHub
- URL: https://github.com/marconi1992/algolite
- Owner: marconi1992
- Created: 2019-02-03T03:22:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-04T10:11:07.000Z (11 months ago)
- Last Synced: 2024-12-30T08:06:25.125Z (4 months ago)
- Topics: algolia, local-development
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/algolite
- Size: 451 KB
- Stars: 52
- Watchers: 2
- Forks: 15
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Algolite
An Implementation of [Algolia](https://www.algolia.com/) to emulate its REST API on your local machine or CI environments in order to speed up your development and testing cycles.## Installation
```
npm run -g algolite
```## Example
```
$ algolite --helpUsage: algolite [--port ] [--path ]
An Algolia REST API Implementation
Options:
--help Display this help message and exit
--port The port to listen on (default: 9200)
--path The path to use for the LevelDB store (Your project folder)
```Once running any algolia client can be used.
```javascript
const client = algoliasearch('app-id', 'api-key', {
protocol: 'http:',
hosts: {
read: ['localhost:9200'],
write: ['localhost:9200']
}
})const index = client.initIndex('entries');
await index.addObject({
title: 'Algolia 2019',
contentType: 'events'
})const result = await index.search('Algolia')
```## Docker Image
```
docker run --rm -p 9200:9200 --name algolite marconi1992/algolite:0.1.1
```