Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brendanashworth/staticize
Basic route -> static file mapping with ExpressJS
https://github.com/brendanashworth/staticize
Last synced: 9 days ago
JSON representation
Basic route -> static file mapping with ExpressJS
- Host: GitHub
- URL: https://github.com/brendanashworth/staticize
- Owner: brendanashworth
- License: mit
- Created: 2014-05-27T03:48:05.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-16T02:20:38.000Z (about 10 years ago)
- Last Synced: 2023-04-10T02:51:02.669Z (over 1 year ago)
- Language: JavaScript
- Size: 164 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Staticize
======![Staticize NPM](https://nodei.co/npm/staticize.png)
> Staticize is a basic NPM module for routing to static files on an ExpressJS installation. For every route provided, Staticize will respond from a simple GET request to the route and respond with the given file location. If an error occurs, it will log directly to the console.
### Install
```bash
$ npm install staticize --save
```### Usage
```javascript
var staticize = require('staticize'),
express = require('express'),
app = express();staticize(app, {
'/foo': '../test/foo/bar.txt',
'/foo/more': '../test/foo-extra/bar.txt'
});app.listen(3000);
```