https://github.com/ff6347/echo-server
https://github.com/ff6347/echo-server
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ff6347/echo-server
- Owner: ff6347
- License: mit
- Created: 2022-07-25T08:34:25.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-12T02:12:45.000Z (over 2 years ago)
- Last Synced: 2025-01-24T18:35:24.405Z (over 1 year ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Echo Server
Simple js script that creates a server that listens on port 8000 and echoes back the message it receives.
## Setup
```bash
npm ci
node index.js
```
## Usage
```bash
# POST
curl -X POST -H 'Content-Type: application/json' -d '["Hello World"]' 'http://localhost:8000'
# or on an different route
curl -X POST -H 'Content-Type: application/json' -d '["Hello World"]' 'http://localhost:8000/foo/bah'
# GET
curl 'http://localhost:8000/foo/bah'
```