npm install --save node-shhSimple server static. Wrote on native Node.js!
It would be good a point for you if you need a fast setup server to provide access to the public files. I recommend using this package only for the development process, no for production.
Why this library, no something else? Cause only here you can found powerful features that help you in development way (at least create static server) and we proud of the stability and performance of our product.
If you haven't enough time for reading a lot of instructions or chief annoying you with phrases like this one: - 'Just do it! And faster please!' Just do this simple steps:
-
Install
npm install node-shh
-
Create server.js file and put this code here:
const { StaticServer } = require('node-shh'); StaticServer.setup().startServer();
-
Create
publicfolder at the same level as the server.js file. -
Put several files for sharing to the
publicfolder. For starting to create theindex.htmandtext.txt;) -
Launch the browser and go to
http://127.0.0.1:4040. Then you can choose any file in your folder for sharing, for example -http://127.0.0.1:4040/text.txt.
- Cache functionality (simple/watcher)
- Possibility to handle errors
- Setup custom server config
- Pass different headers
- Download files
- Show directories structure
Check more examples in __examples folder
- Use default util - pipeline
- Templates issue
- Rename Cache to CacheStorage
- Cover the project with tests
- Write article
- Push last changes
- Push to npm
Feel free to connect with me and notify about all weak parts that you found. You can create an issue on GitHub.
More soon...