Socket
Socket
Sign inDemoInstall

certbot-express

Package Overview
Dependencies
83
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    certbot-express

simple and free http2 with express | 简单免费给express升级http2


Version published
Maintainers
1
Install size
2.70 MB
Created

Readme

Source

certbot-express

simple and free http2 with express | 简单免费给express升级http2

prepare | 准备

if you are not using certbot, skip this | 如果你不使用certbot,跳过此步骤

certbot

install certbot

generate certification | 生成证书

point your domain to your server | 将域名指向要部署的服务器

certbot certonly

see full conversation here | 查看命令对话详情

install | 安装

npm install certbot-express

usage | 使用

const express = require('express')
const { redirect, http2 } = require('certbot-express')

const app = express()
const certDir = '/etc/letsencrypt/live/test.i18ntech.com/' // you can get certDir from env
const dev = process.env.NODE_ENV !== 'production'

app.use(redirect)
app.use('/', (req, res) => {
  res.send('http2!')
})

http2({
  dev,  //if dev is true only http is served, all about http2 are skipped
  certDir,
  app,
}).listen().then(() => {
  console.log('server started')
}).catch((e) => {
  console.log(e)
})

or | 或者

http2({
  keyPath:'/etc/letsencrypt/live/test.i18ntech.com/privkey.pem',
  certPath:'/etc/letsencrypt/live/test.i18ntech.com/fullchain.pem'
  app,
})

renew certification | 更新证书

it might be something like this, you can add it to your cron job

certbot renew --pre-hook "forever stop app.js" --post-hook "forever start app.js"

FAQs

Last updated on 01 Mar 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc