A test project with nodejs - build up proxy server
- Start server with command :
$ node index.js
- Test your server with curl :
$ curl http://127.0.0.1:8080/sub-uri
- Update with .pipe from Request
- Test command:
$ curl http://127.0.0.1:8080/sub-uri -d "hello there"
$ curl -v -X POST http://127.0.0.1:8080/new -d "hello me" -H "x-qwerty: yeap"
- Add request package :
$ npm install --save request
- Update proxy code
- Test command:
$ curl -v http://127.0.0.1:8001/org-uri -d "hello proxy"
- Start test server:
$ node index.js --port=8003
- Proxy command:
$ curl -v http://127.0.0.1:8001/org-uri -d "request with a CLI"