hinos-serve
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

hinos-serve

A plugin helps route static resource (.jpg, .png, .zip...) for hinos

Install

npm i hinos-serve -S

Features

  1. Serve static resources to download
  2. Base on querystring ?name=abc&download=true it's will auto add attachment file name to download

Examples

Typescript

import { Server } from 'hinos';
import { serve } from 'hinos-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 hinos = require("hinos");
const hinosServe = require("hinos-serve");
 
hinos.Server.use(hinosServe.serve({
    '/images': path.join(__dirname, 'path to folder which contains resource files'),
    '/files': path.join(__dirname, 'path to folder which contains resource files'),
}));

Readme

Keywords

none

Package Sidebar

Install

npm i hinos-serve

Weekly Downloads

2

Version

2.0.2

License

ISC

Unpacked Size

8 kB

Total Files

7

Last publish

Collaborators

  • doanthuanthanh88