Skip to content

andrepolischuk/servst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

servst Build Status

Simple file server

servst-cli - CLI for this module

Install

npm install --save servst

Usage

var http = require('http');
var servst = require('servst');
var statics = servst(__dirname + '/static');

http.createServer(function(req, res) {
  statics(req, res, function(err) {
    if (err) {
      res.writeHead(404, {'Content-Type': 'text/plain'});
      res.end('Not found');
    }
  });
}).listen(3000);

With express

var express = require('express');
var servst = require('servst');
var app = express();
var statics = servst(__dirname + '/static');

app.use(statics);
app.listen(3000);

License

MIT

About

Simple file server

Resources

License

Stars

Watchers

Forks

Packages

No packages published