1.0.7 • Published 6 years ago

pusudb-use-static-file v1.0.7

Weekly downloads
2
License
MIT
Repository
-
Last release
6 years ago

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

Installing

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.

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)
})

Authors

  • Yannick Grund - Initial work - yamigr

License

This project is licensed under the MIT License

1.0.7

6 years ago

1.0.6

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.22

7 years ago

0.0.21

7 years ago

0.0.20

7 years ago

0.0.19

7 years ago

0.0.18

7 years ago

0.0.17

7 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago