# pusudb-use-static-file

> A static-file middleware for the pusudb-framework.

Latest version **1.0.7** (published 2018-12-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install pusudb-use-static-file
pnpm add pusudb-use-static-file
yarn add pusudb-use-static-file
bun add pusudb-use-static-file
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2018-12-21 |
| First published | 2018-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yannick grund, https://github.com/yamigr |
| Maintainers | yamigr |
| Keywords | pusuDB, pusudb, server, middleware, extension, web, http, html, static, webpage, IoT, frameworks, framework, backend, static-file, webservice, REST |

## Links

- npm: https://www.npmjs.com/package/pusudb-use-static-file
- Homepage: https://github.com/yamigr/pusudb-use-static-file#readme
- npm.io page: https://npm.io/package/pusudb-use-static-file

## Dependencies (1)

- [findfile-in-folder-by-pathname](https://npm.io/package/findfile-in-folder-by-pathname.md) 0.0.7

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.7 (latest) — 2018-12-21
- 1.0.6 — 2018-11-21
- 1.0.4 — 2018-11-19
- 1.0.3 — 2018-11-19
- 1.0.2 — 2018-11-19
- 1.0.1 — 2018-11-18
- 1.0.0 — 2018-11-18
- 0.0.22 — 2018-11-17
- 0.0.21 — 2018-11-12
- 0.0.20 — 2018-11-12
- 0.0.19 — 2018-11-12
- 0.0.18 — 2018-11-11
- 0.0.17 — 2018-11-11
- 0.0.16 — 2018-11-07
- 0.0.15 — 2018-11-07
- … 14 more at https://npm.io/package/pusudb-use-static-file/versions

## README

# pusudb-use-static-file

> Middleware to serve static-files with the pusudb-framework.

This middleware adds a file-handler to the pusudb-framework to serve static files.

Framework: [ pusudb ](https://www.npmjs.com/package/pusudb)

<a name="installing"></a>
## Installing

```sh
npm install pusudb-use-static-file --save
```

## Use
Define the path where the static-files are located. Define some url's which should be escaped. To define a url-prefix use the option prefix.

```js
var Pusudb = require('pusudb')
var pusudb = new Pusudb(3000, 'localhost', { log : true })

var Static = require('pusudb-use-static-file')

// prefix '/css' : http://localhost:3000/css/main.css
var static = new Static(__dirname + '/node_modules/css', ['/db', /* blocked pathnames */], { prefix : '/css' }) 

//add the middleware to the pusudb
pusudb.use('http', static.serve)

pusudb.listen(function(port, host){
    console.log('pusudb listening:', port, host)
})
```
<a name="authors"></a>

## Authors

* **Yannick Grund** - *Initial work* - [yamigr](https://github.com/yamigr)

<a name="license"></a>

## License

This project is licensed under the MIT License

---
_Source: https://npm.io/package/pusudb-use-static-file · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
