This commit is contained in:
lnn0q 2025-07-08 16:36:00 +03:00
parent c8f68b7486
commit e5126a4aca
6 changed files with 56 additions and 288 deletions

View file

@ -7,7 +7,7 @@ import 'dotenv/config';
import express from 'express';
import fs from 'fs';
import { GraphQLJSON } from 'graphql-scalars';
import https from 'https';
import http from 'http';
import path from 'path';
import ViteExpress from 'vite-express';
import { toAppConfig } from './config';
@ -18,11 +18,16 @@ import { getIdentityContext, IdentityContext } from './identity';
export const config = toAppConfig();
const __dirname = import.meta.dirname;
const key = fs.readFileSync(path.join(__dirname + '../../../certs/selfsigned.key'));
const cert = fs.readFileSync(path.join(__dirname + '../../../certs/selfsigned.crt'));
// todo - make built-in ssl conditional
// const key = fs.readFileSync(path.join(__dirname + '../../../certs/selfsigned.key'));
// const cert = fs.readFileSync(path.join(__dirname + '../../../certs/selfsigned.crt'));
const app = express();
const server = https.createServer({ key, cert }, app);
// todo - make built-in ssl conditional
// const server = https.createServer({ key, cert }, app);
const server = http.createServer(app);
const typeDefs = fs.readFileSync(path.join(__dirname, 'graphql', 'schema.graphql'), 'utf8');