https://github.com/jayvirrathi/node-redis-rest-api
REST API with Node.js,redis
https://github.com/jayvirrathi/node-redis-rest-api
nodejs redis redis-om rest-api
Last synced: 3 months ago
JSON representation
REST API with Node.js,redis
- Host: GitHub
- URL: https://github.com/jayvirrathi/node-redis-rest-api
- Owner: Jayvirrathi
- Created: 2022-01-12T13:18:35.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-12T15:25:12.000Z (over 4 years ago)
- Last Synced: 2025-08-31T18:05:06.433Z (10 months ago)
- Topics: nodejs, redis, redis-om, rest-api
- Language: JavaScript
- Homepage:
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# REST API with Node.js, Redis using Redis-Om
## Prerequisites
- Nodejs
- Redis/Docker
## Build Setup
```bash
# install dependencies
npm install
```
## Env
Rename file named `.env.sample` to `.env`.
### docker
```
docker run -p 6380:6379 redislabs/redismod:preview
```
```
REDIS_URL=redis://localhost:6380
```
### cloud url
```
REDIS_URL=redis://default:PASSWORD@HOST:PORT
```
## Start Project [url](http://localhost:8080/)
```
npm run dev
```
**Request:**
### User
### create Index for search
```
POST api/v1/create/song/
```
```
POST api/v1/song/
{
"title": "Bug in the JavaScript",
"artist": "Dylan Beattie and the Linebreakers",
"genres": ["folk rock", "parody", "pop rock", "rock"],
"lyrics": "It’s nine-o-clock on a Saturday,\\nYou should be out having fun,\\nBut there’s one bug left in the next release,\\nAnd you’re not going out ‘till it’s done,\\n\\nYou’ve checked all the database indexes,\\nYou’ve tested your API hooks,\\nAnd you’re starting to think, that you might need that drink\\n‘Cos there’s only one place left to look…\\n\\nThere must be a bug in the JavaScript,\\nThe bug’s in the single page app,\\nBecause everything else was built properly,\\nBut the front end’s a pile of crap\\n\\nNow null is a reference to nothing,\\nDon’t mix it up with undefined,\\nAnd there’s zero and NaN, and Infinity, man,\\nJust remember which ones can be signed,\\nAnd you think that you’re working with integers,\\nWhen you’re really in floating point hell,\\nAnd your objects are hashes, but when your code crashes,\\nYou’ll find they were functions as well,\\n\\nIt was never intended to do all this,\\nThey say it was built in ten days,\\nBut it’s out of the bottle, it’s going full throttle,\\nWe’ve all caught the JavaScript craze,\\nWell we use it for code that runs everywhere,\\nFrom the cloud to your mobile phone,\\nBut we’re sharing a string padding library,\\n‘Cos it’s better than writing our own\\n\\nNow JavaScript’s not a bad language,\\nThough it’s frequently misunderstood,\\nBut before you see what you can use it for,\\nPlease stop to think whether you should,\\nBecause just about everything’s true here,\\nIt’s all part of the language design\\nExcept zero, blank strings, the array of no things,\\nAnd the end of 1969",
"music": "\"Piano Man\" by Billy Joel",
"year": 2019,
"duration": 360,
"link": "https://www.youtube.com/watch?v=jxi0ETwDvws"
}
```