https://github.com/dinbtechit/ns-ceiling-fan-backend
NS Ceiling Fan Backend
https://github.com/dinbtechit/ns-ceiling-fan-backend
Last synced: about 1 year ago
JSON representation
NS Ceiling Fan Backend
- Host: GitHub
- URL: https://github.com/dinbtechit/ns-ceiling-fan-backend
- Owner: dinbtechit
- Created: 2022-06-02T01:25:39.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-09-28T02:05:07.000Z (over 3 years ago)
- Last Synced: 2025-04-06T02:44:03.050Z (about 1 year ago)
- Language: TypeScript
- Homepage: https://github.com/dinbtechit/ns-ceiling-fan
- Size: 188 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NS Ceiling Fan Backend (APIs)
**Technologies**
- NestJS (A progressive nodejs framework)
- REST API
- Server Sent Events for Event Driven Communication to client-side.
- Redis for cache
## Installation
```bash
$ npm install
```
## Running the app
```bash
# watch mode
$ npm run start:dev
```
## Test
```bash
# unit tests
$ npm run test
```
# API Details:
1. Get Fan Status
```
curl -X GET "http://localhost:3000/api/v1/fan/status"
```
**output**
```
{ speed: 0, direction: true }
```
2. PUT pull Cord 1
```
curl -X PUT "http://localhost:3000/api/v1/fan/cord/pull/1"
```
3. PUT pull Cord 2
```
curl -X PUT "http://localhost:3000/api/v1/fan/cord/pull/2"
```
4. To Listen For SSE events.
```
curl -X GET "http://localhost:3000/api/v1/fan/cord/pull/sse"
```