Download server/app/middlewares/static.js from jimlv/ssh: direct link, hf CLI and curl.
- Browser
- Download file 339 Bytes
-
https://huggingface.co/spaces/jimlv/ssh/resolve/main/server/app/middlewares/static.js
- Command line
-
hf download hf://spaces/jimlv/ssh/server/app/middlewares/static.js
-
curl -L -o static.js https://huggingface.co/spaces/jimlv/ssh/resolve/main/server/app/middlewares/static.js
339 Bytes
| const koaStatic = require('koa-static') | |
| const { staticDir } = require('../config') | |
| const useStatic = koaStatic(staticDir, { | |
| maxage: 1000 * 60 * 60 * 24 * 30, | |
| gzip: true, | |
| setHeaders: (res, path) => { | |
| if (path && path.endsWith('.html')) { | |
| res.setHeader('Cache-Control', 'max-age=0') | |
| } | |
| } | |
| }) | |
| module.exports = useStatic | |