Skip to content

Commit

Permalink
Updated webpack to use wevotedeveloper.com SSL if configured
Browse files Browse the repository at this point in the history
Works on Safari and Firefox for webapp, but not on Chrome.
Works on Chrome for local Python API server.
  • Loading branch information
SailingSteve committed Feb 20, 2024
1 parent 05a8a40 commit 437c5ce
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions serverWevotedeveloper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/* eslint-disable */
// start the express server
const express = require("express");
const app = express();
const fs = require("fs");
const https = require("https");
const path = require("path");
const webAppConfig = require("./src/js/config");

const port = 3000;
const opts = { redirect: true };
const hostname = "wevotedeveloper.com";

app.use("/", express.static("build", opts));
app.all("*", (req, res) => res.sendFile(__dirname + "/build/index.html"));

const certOptions = {
key: fs.readFileSync(path.resolve(__dirname + "/src/cert/wevotedeveloper.com_key.txt")),
cert: fs.readFileSync(path.resolve(__dirname + "/src/cert/wevotedeveloper.com.crt")),
};

const server = https.createServer(certOptions, app).listen(port, function () {
console.log("INFO: https server started", new Date());
console.log(`INFO: Server is at https://${hostname}:${port}`);
});

0 comments on commit 437c5ce

Please sign in to comment.