als-send-file
Version:
file serving with advanced options for caching, headers, and error handling, compatible with Express middleware.
14 lines (12 loc) • 421 B
JavaScript
const Schema = require('als-schema')
const {optional,number,string,list} = Schema
const optionsSchema = new Schema({
charset: [optional,string(1,50)],
maxAge: [optional,number(1,Infinity,3600)],
public: [optional,list(['public','private'],'public')],
etag: [true,Boolean],
download: [false,Boolean],
noCache: [false,Boolean],
noStore: [false,Boolean],
})
module.exports = optionsSchema