文件名称:https-only:ExpressJS中间件强制应用程序仅接受HTTPS请求
文件大小:3KB
文件格式:ZIP
更新时间:2024-06-03 22:10:24
JavaScript
仅https ExpressJS中间件强制应用程序仅接受HTTPS请求。 安装 $ npm install https-only 用法 var httpsOnly = require ( 'https-only' ) var express = require ( 'express' ) var app = express ( ) // Enable https-only app . use ( httpsOnly ( ) ) // Any routes beneath the https-only middleware will need to be // accessed via HTTPS app . use ( '/' , function ( req , res ) { res . send ( 'hello world' ) } ) // Error handler
【文件预览】:
https-only-master
----lib()
--------index.js(697B)
----test()
--------index.js(2KB)
----README.md(837B)
----.gitignore(30B)
----package.json(527B)