https://github.com/samuelteixeiras/nodeechoserver
Echo server with node js and socket-io
https://github.com/samuelteixeiras/nodeechoserver
docker nodejs socket-io
Last synced: 3 months ago
JSON representation
Echo server with node js and socket-io
- Host: GitHub
- URL: https://github.com/samuelteixeiras/nodeechoserver
- Owner: samuelteixeiras
- Created: 2018-07-18T19:24:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T07:41:34.000Z (over 3 years ago)
- Last Synced: 2025-08-31T10:59:18.939Z (10 months ago)
- Topics: docker, nodejs, socket-io
- Language: JavaScript
- Homepage: https://github.com/samuelteixeiras/nodeEchoServer
- Size: 396 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Echo Server To Test HTTP Post Calls
Http server to test HTTP POST call, we have two endpoints: successfulNotification and failureNotification.
## Message returned example:

## Running on local machine
Clone the repository: git clone https://github.com/samuelteixeiras/nodeEchoServer.git
Go into the folder: `nodeEchoServer`
Run the commands:
`npm install`
`npm start`
Open the browser and go to to http://localhost:3000
`/successfulNotification`
To send a successful notification to the server, use the following command:
### Successful Notification call example:
curl -X POST \
http://localhost:3000/successfulNotification \
-H 'content-type: application/json' \
-H 'key: lpdlapdsa' \
-d '{ "samuel":"test"}'
`/failureNotification`
To send a failure notification to the server, use the following command:
### Failure Notification call example:
curl -X POST \
http://localhost:3000/failureNotification \
-H 'content-type: application/json' \
-H 'key: lpdlapdsa' \
-d '{ "samuel":"test"}'
---
## Steps to create and run using a Docker container
docker build -t username/node-web-app .
docker run -p 8080:3000 -d username/node-web-app
Go to http://localhost:8080
## After Deploy call the server:
### Successful Notification call example:
curl -X POST \
http://localhost:8080/successfulNotification \
-H 'content-type: application/json' \
-H 'key: lpdlapdsa' \
-d '{ "samuel":"test"}'
### Failure Notification call example:
curl -X POST \
http://localhost:8080/failureNotification \
-H 'content-type: application/json' \
-H 'key: lpdlapdsa' \
-d '{ "samuel":"test"}'
---
Created based on https://github.com/socketio/chat-example.git