Skip to content

Commit

Permalink
perf(cmd-api-server): shrink API server bundle with type-only imports
Browse files Browse the repository at this point in the history
Great explanation can be found here:
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html

Signed-off-by: Peter Somogyvari <[email protected]>
  • Loading branch information
petermetz committed May 24, 2021
1 parent 240bb1a commit 4875fc3
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions packages/cactus-cmd-api-server/src/main/typescript/api-server.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
import path from "path";
import { gte } from "semver";
import { AddressInfo } from "net";
import type { AddressInfo } from "net";
import tls from "tls";
import { Server, createServer } from "http";
import { Server as SecureServer } from "https";
import type { Server as SecureServer } from "https";
import { createServer as createSecureServer } from "https";
import { gte } from "semver";
import npm from "npm";
import expressHttpProxy from "express-http-proxy";
import express, {
Express,
Request,
Response,
RequestHandler,
Application,
} from "express";
import type { Application, Request, Response, RequestHandler } from "express";
import express from "express";
import { OpenApiValidator } from "express-openapi-validator";
import compression from "compression";
import bodyParser from "body-parser";
Expand Down Expand Up @@ -377,7 +372,7 @@ export class ApiServer {
},
});

const app: Express = express();
const app: Application = express();
app.use("/api/v*", apiProxyMiddleware);
app.use(compression());
app.use(corsMiddleware);
Expand Down

0 comments on commit 4875fc3

Please sign in to comment.