1.0.0 • Published 5 years ago
poom-serve v1.0.0
poom-serve
A plugin helps route static resource (.jpg, .png, .zip...) for poom
Install
npm i poom-serve -S
Features
- Serve static resources to download
- Base on querystring
?name=abc&download=true
it's will auto add attachment file name to download
Examples
Typescript
import { Server } from 'poom';
import { serve } from 'poom-serve';
Server.use(serve({
'/images': path.join(__dirname, 'path to folder which contains resource files'),
'/files': path.join(__dirname, 'path to folder which contains resource files'),
}));
Javascript
const poom = require("poom");
const poomServe = require("poom-serve");
poom.Server.use(poomServe.serve({
'/images': path.join(__dirname, 'path to folder which contains resource files'),
'/files': path.join(__dirname, 'path to folder which contains resource files'),
}));