Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/travishorn/node-extendedlisteners
This snippet intercepts requests on an http server and serves its own content.
https://github.com/travishorn/node-extendedlisteners
Last synced: 30 days ago
JSON representation
This snippet intercepts requests on an http server and serves its own content.
- Host: GitHub
- URL: https://github.com/travishorn/node-extendedlisteners
- Owner: travishorn
- Created: 2012-09-12T20:28:11.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-09-12T20:35:23.000Z (over 12 years ago)
- Last Synced: 2024-04-14T11:56:24.183Z (9 months ago)
- Language: JavaScript
- Size: 93.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
extendedListeners
-----------------This snippet intercepts requests on an http server and serves its own content.
Require this module and call the listen method, passing the http server object. Then, add resources using the addResource method, passing the url and the location of the file to serve.
Any request's url that matches something in the resource array will be responded to with the data in the specified file. This is a simplified solution taken from socket.io.