showing results for - "https with express"
Benjamín
12 Nov 2016
1const fs = require('fs');
2const https = require('https');
3
4const app = require('express')();
5app.get('*', (req, res) => res.send('<h1>Hello, World</h1>'));
6
7const server = https.createServer({
8  key: fs.readFileSync(`${__dirname}/localhost-key.pem`, 'utf8'),
9  cert: fs.readFileSync(`${__dirname}/localhost.pem`, 'utf8')
10}, app);
11
12await server.listen(443);
Valentino
24 May 2019
1var express = require('express');var app = express(); var redirectToHTTPS = require('express-http-to-https').redirectToHTTPS // Don't redirect if the hostname is `localhost:port` or the route is `/insecure`app.use(redirectToHTTPS([/localhost:(\d{4})/], [/\/insecure/], 301)); app.get('/', function (req, res) {  res.send('Hello World!');}); app.get('/insecure', function (req, res) {  res.send('Dangerous!');}); app.listen(3000, function () {  console.log('Example app listening on port 3000!');}); app.listen(8080, function () {  console.log('Example app listening on port 8080 insecurely!');});
queries leading to this page
node express on httpsexpress http https bothnpm express http to httpsexpress https wsexpress js to httpshow to make api using https expressnode js express http and httpsget https website with expressexpress create https serverexpress js forward http to httpsnodejs express with httpsexpress https on nodeuse express on httpshttps in expressexpress get http or httpsexpress make httpsexpress httpshttps server expressenable https in node js expresshttps create server with expresshttps add in expresssample code to start an express server with httpshow to use https expresshow to make express httpsnodejs express app httpshttps request with expresshttps or expressdoes https work with expressjsexpress js use httpsexpress https serverexpress js listening on http and httpsforce www to use https expressjsis express httpsnodejs https express samplehttps only express jsnodejs https server with expresshow to get https on expressdoes expressjs support getting via httpsexpress https nodejsexpress http to https npmlancer une application node express en httpsredirect not https to https expressusing https on expressexpress https codenode express http and httpshttps on express jsnode express https apiuse https with expressnodejs https expressexpress how to make express only use httpshow to enable https in express jsexpress https requestsetup https for expresshttps express jshttps request in expressexpress start httpsexpress check if http or httpshttps to http in expresshttps nodejs expressexpress using https 3fexpress http to httpssimple https express serevrhttps expressnode js express httpshttps express servernode express https serverhow to make my express server httpsexpress https onlyhow make api with https expresshow to setup express with httpsuse https on expresshttps with expressnode js express http httpshttps using expressmake express httpshow to change an http to https in express jsexpress server how to redirect http to httpsexpress https listenexpress https tutorialuse https in express serverexpress how to server over httphttps node js expresshttps for api expresshow to use express with httpsexpress https hostnode js https express exampleexpress use https http https express jsexpress server https2express api httpshow to make your express app httpsis express js a http or https 3frequest get http or https expresshow to make express js web server httpsnode express https server examplehow to run express server on https express with httpshow to add https in express js appnode js https expressexpress get httpsexpress router httpsexpress server httpshow to use local https expresshow to create https express serverhttps server with expresshow to use https in expressworking on https with expresshttps code expresshttps expressjsexpressjs http to httpsexpress js make httpsexpress enforce httpsuse https expressreceiveing data from https get express appexpress https localnodejs expressjs app listen to httpsnode express httpsstart express server on httpsnode server https expressnode js express https setupnode js express https server exampleexpress with httpsfrom express app to httpsexpress https exampleget https request with expressexpress run httpshttps and expressexpress listen http and httpshttps nodejs express serverlisten on http and https for as single express apphttps express appexpress js https requestserve is listening on http or https express jsexpress js make a https serverexpress rest api httpsbasic https express servernodejs express https examplehow to use express js to create an https nodejs web serverexpress requrie httpshttps on expressexpressjs httpsexpress https to httpnode js express with httpshow to make express app httpsexpress js for httpshow to send a https status in expressexpress https clientexpress and httpserverexpressjs http and httpsexpress https requestcertnode express https and http servernodejs express httpsexpress create server httpsrun express on httpshandling https expressmkcert express https on localhostexpressjs https listenexpress with httpserverhttps express nodejshttps in node js expressexpress redirect http to https options requesthttps express nodejs serverhttps get in expresshow to run a server on https in expressnodejs send express over httpsnodejs express https api callexpress js with httpsexpress js https serverrun https expressrun express in httpsexpress js httpsnodejs http to httpshttp to https expresshow to setup https in expressdoes express create an https serverhttps express jsexpress make it httpshow to make https server expressexpress enable httpshow to use https for express nodenode express https require https optionsexpress js use httpsadd https on nodejs express appexpress run app at both https and httphttps express backendhow to make a https nodejs express site node express redirect https to httpnode js express httpsnode express set httpshost https expresshttps support with expresshow to make my connection https in expressexpress server how to redierct to httpsexpress start server on httpshandle https expressget request usong https express nodejshow to make express server httpsexpress https defineserve https expresshow to implement https in express jsexpress js both http and httpsrun express server on httpshow deploy express server with httpsnode js express use httpsexpress https local developmenthttp vs https requests expressexpress make https requestexpress js httpshow to make express api using httpsusing the nodejs https expressexpress local httpsexpress serving httpsexpress https methpdsrun https with express node jshttps server expressjsset up express httpshow to force https on expressjshttps node expresshttp or https in express serverhow to check express http or httpsdo express use httpshow to make express api from http to httpsis express http or https 3fexpress use httpsstart express on https localhosthttps with express