Merge remote-tracking branch 'origin/UMBE' into UMBE
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
"test:e2e": "cypress run",
|
||||
"test:unit": "bun test",
|
||||
"format": "prettier --write .",
|
||||
"build:production": "astro build && bun --bun server.js",
|
||||
"build:production": "astro build && bun --bun server.ts",
|
||||
"i18n:generate": "bunx astro-i18next generate",
|
||||
"prisma:studio": "bunx prisma studio --schema=./node_modules/@ibcornelsen/database/prisma/schema.prisma"
|
||||
},
|
||||
@@ -63,12 +63,13 @@
|
||||
"@faker-js/faker": "^8.4.1",
|
||||
"@tailwindcss/typography": "^0.5.15",
|
||||
"@types/body-scroll-lock": "^3.1.2",
|
||||
"@types/express": "^5.0.0",
|
||||
"@types/fontkit": "^2.0.7",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"@types/uuid": "^9.0.8",
|
||||
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
||||
"@typescript-eslint/parser": "^5.62.0",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"bun-types": "^1.1.34",
|
||||
"cypress": "^13.15.2",
|
||||
"cypress-file-upload": "^5.0.8",
|
||||
|
||||
10
server.js
10
server.js
@@ -1,10 +0,0 @@
|
||||
import express from 'express';
|
||||
import { handler as ssrHandler } from './dist/server/entry.mjs';
|
||||
|
||||
const app = express();
|
||||
app.use(express.static('dist/client/'))
|
||||
app.use(ssrHandler);
|
||||
|
||||
app.listen(80);
|
||||
|
||||
console.log("Server listening on port 80");
|
||||
33
server.ts
Normal file
33
server.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import express from 'express';
|
||||
import { handler as ssrHandler } from './dist/server/entry.mjs';
|
||||
import https from "https"
|
||||
import * as fs from "fs"
|
||||
|
||||
|
||||
const app = express();
|
||||
const base = '/';
|
||||
app.use(base, express.static('dist/client/'));
|
||||
app.use(ssrHandler);
|
||||
|
||||
app.listen(80, function() {
|
||||
console.log('Server started on http://localhost:80');
|
||||
});
|
||||
|
||||
const privateKey = fs.readFileSync('/etc/letsencrypt/live/ibcornelsen.de/privkey.pem', 'utf8');
|
||||
const certificate = fs.readFileSync('/etc/letsencrypt/live/ibcornelsen.de/cert.pem', 'utf8');
|
||||
|
||||
if (privateKey && certificate) {
|
||||
https.createServer({
|
||||
key: privateKey,
|
||||
cert: certificate
|
||||
}, app).listen(443, function() {
|
||||
console.log('Server started on https://localhost:443');
|
||||
});
|
||||
} else {
|
||||
console.error('No SSL certificate found');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user