Skip to content

Commit

Permalink
update certs
Browse files Browse the repository at this point in the history
  • Loading branch information
petertimwalker committed May 24, 2024
1 parent 6c38e1b commit 35f2a20
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const fs = require('fs');
const express = require('express');
const cors = require('cors');
const app = express();
const PORT = process.env.PORT || 3000;
const PORT = process.env.PORT || 443;

// Use CORS middleware to allow requests from all origins
app.use(cors());
Expand All @@ -29,8 +29,9 @@ app.get('/api/key', (req, res) => {

// HTTPS options
const options = {
key: fs.readFileSync('server.key'),
cert: fs.readFileSync('server.crt')
key: fs.readFileSync('/etc/letsencrypt/live/api.peterwalker.xyz/privkey.pem'),
cert: fs.readFileSync('/etc/letsencrypt/live/api.peterwalker.xyz/cert.pem'),
ca: fs.readFileSync('/etc/letsencrypt/live/api.peterwalker.xyz/chain.pem')
};

// Start the HTTPS server
Expand Down

0 comments on commit 35f2a20

Please sign in to comment.