https://github.com/charto/csrv
Compact development web server
https://github.com/charto/csrv
Last synced: 9 months ago
JSON representation
Compact development web server
- Host: GitHub
- URL: https://github.com/charto/csrv
- Owner: charto
- License: mit
- Created: 2016-03-08T10:14:48.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-09-26T14:40:28.000Z (over 8 years ago)
- Last Synced: 2025-03-18T07:07:18.309Z (10 months ago)
- Language: TypeScript
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
csrv
====
[](http://travis-ci.org/charto/csrv)
[](https://david-dm.org/charto/csrv)
[](https://www.npmjs.com/package/csrv)
This is a simple Node.js -based HTTP server for static files.
No bloat. Under 10 KB download, no dependencies.
Perfect for bundling a fully working demo with frontend JavaScript projects.
Usage
-----
```
Usage: csrv [OPTION]... DIRECTORY
Start HTTP server with public root in DIRECTORY.
Options:
-p, --port=PORT Bind to given TCP port (default 8080).
```
Calling from TypeScript
-----------------------
```TypeScript
import { Server } from './Server';
new Server('public_html').listen(8080, (err: null | NodeJS.ErrnoException) => {
if(!err) console.log('Serving...');
});
```
License
=======
[The MIT License](https://raw.githubusercontent.com/charto/csrv/master/LICENSE)
Copyright (c) 2016-2017 BusFaster Ltd