Archived
1
0

feat: use compression in express server (#2680)

This commit is contained in:
Justin Poehnelt
2021-02-12 13:27:33 -07:00
committed by GitHub
parent 1272bf9a52
commit 97c1399401
3 changed files with 48 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import { logger } from "@coder/logger"
import compression from "compression"
import express, { Express } from "express"
import { promises as fs } from "fs"
import http from "http"
@ -13,6 +14,8 @@ import { handleUpgrade } from "./wsRouter"
export const createApp = async (args: DefaultedArgs): Promise<[Express, Express, http.Server]> => {
const app = express()
app.use(compression())
const server = args.cert
? httpolyglot.createServer(
{