Skip to content

Instantly share code, notes, and snippets.

@seatedro
Created August 26, 2022 13:51
Show Gist options
  • Save seatedro/668d8cf09fa6fac8888f570eaa1221f3 to your computer and use it in GitHub Desktop.
Save seatedro/668d8cf09fa6fac8888f570eaa1221f3 to your computer and use it in GitHub Desktop.
Transcription Server 1
import express, { Express, Request, Response } from "express";
import { createServer } from "https";
const app: Express = express();
const server = createServer(
{
key: fs.readFileSync("key.pem"),
cert: fs.readFileSync("cert.pem"),
},
app
);
const port = 3000;
const io = new Server(server, {
cors: {
origin: "*",
},
});
server.listen(port, () => {
console.log(`⚡️[server]: Server is running at https://localhost:${port}`);
});
@davericher
Copy link

This code is broken ^

import express, { Express, Request, Response } from "express";
import { createServer } from "https";
import { Server } from "socket.io";
import * as fs from 'fs';

const app: Express = express();
const server = createServer(
  {
    key: fs.readFileSync("key.pem"),
    cert: fs.readFileSync("cert.pem"),
  },
  app
);
const port = 3000;
const io = new Server(server, {
  cors: {
    origin: "*",
  },
});

server.listen(port, () => {
  console.log(`⚡️[server]: Server is running at https://localhost:${port}`);
});

tips hat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment