nested-static
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

nested-static

🗂️ Helps register nested folders to the express module.

THIS MODULE SUPPORT TYPESCRIPT(.d.ts)

When using Express module, if you register a folder as a function such as us, Can experience it, the folder in that folder does not automatically register a url. nested-static helps you register nested folders in these situations.

Installation

npm install nested-static --save

Example

const nestedStatic = require("nested-static")
 
nestedStatic(`${__dirname}/../static`, (folders)=>{
    for(let {staticPath, subPath} of folders){
        console.log (`Folder Registered ${staticPath} to ${subPath}`)
        app.use(subPath, express.static(staticPath))
    }
})

License

MIT Licensed. (Copyleft)

Package Sidebar

Install

npm i nested-static

Weekly Downloads

5

Version

1.1.0

License

MIT

Unpacked Size

3.45 kB

Total Files

5

Last publish

Collaborators

  • hmmhmmhm