import express from 'express'
import { createServer } from 'http'
import proxyAddr from 'proxy-addr'
-import { Server as WebSocketServer } from 'ws'
+import { WebSocketServer } from 'ws'
import { Redis } from '@server/lib/redis'
import { logger } from '../helpers/logger'
import { CONFIG } from '../initializers/config'
function root () {
if (rootPath) return rootPath
- // We are in /helpers/utils.js
- rootPath = join(__dirname, '..', '..')
+ rootPath = __dirname
+ if (basename(rootPath) === 'helpers') rootPath = resolve(rootPath, '..')
+ if (basename(rootPath) === 'server') rootPath = resolve(rootPath, '..')
if (basename(rootPath) === 'dist') rootPath = resolve(rootPath, '..')
return rootPath
"removeComments": true,
"strictBindCallApply": true,
"esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
"outDir": "./dist",
"lib": [
"dom",
"es2019"
],
"typeRoots": [
- "node_modules/sitemap/node_modules/@types",
"node_modules/@types",
"server/typings"
],