hinos-serve

Module help route serve static resource for hinos

Usage no npm install needed!

<script type="module">
  import hinosServe from 'https://cdn.skypack.dev/hinos-serve';
</script>

README

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'),
}));