Fix SNI lock, update deps, ESM refactor
This commit is contained in:
parent
88662b49bc
commit
447b1b735d
13 changed files with 1204 additions and 1144 deletions
22
index.js
22
index.js
|
|
@ -1,17 +1,17 @@
|
|||
import { config } from "dotenv";
|
||||
import http from "http";
|
||||
import listener from "./src/client.js";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
// development endpoint (use ngrok)
|
||||
|
||||
require('dotenv').config()
|
||||
const http = require('http');
|
||||
const listener = require('./src/client');
|
||||
|
||||
|
||||
const server = http.createServer(listener);
|
||||
const port = parseInt(process.env.HTTP_PORT || "3000");
|
||||
|
||||
if (require.main === module) {
|
||||
if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
||||
config();
|
||||
const port = parseInt(process.env.HTTP_PORT || "3000");
|
||||
server.listen(port, function () {
|
||||
console.log(`server start at port ${port}`);
|
||||
});
|
||||
} else {
|
||||
module.exports = server
|
||||
}
|
||||
}
|
||||
|
||||
export default server;
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue