Skip to content

Commit

Permalink
fix: Server split so that server is run on EE as well (#39435)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharat87 authored Feb 25, 2025
1 parent 9fbf6c3 commit c2bef37
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
11 changes: 1 addition & 10 deletions app/client/packages/rts/src/ce/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import http from "http";
import express from "express";
import type { LogLevelDesc } from "loglevel";
import log from "loglevel";
import { VERSION as buildVersion } from "../version"; // release version of the api

// routes
import ast_routes from "../routes/ast_routes";
Expand All @@ -17,10 +16,8 @@ const logLevel: LogLevelDesc = (process.env.APPSMITH_LOG_LEVEL ||

log.setLevel(logLevel);

const APPSMITH_RTS_PORT = process.env.APPSMITH_RTS_PORT || 8091;

//Disable x-powered-by header to prevent information disclosure
const app = express();
export const app = express();

app.disable("x-powered-by");
const server = new http.Server(app);
Expand All @@ -34,11 +31,5 @@ app.use(`${RTS_BASE_API_PATH}`, health_check_routes);

server.headersTimeout = 61000;
server.keepAliveTimeout = 60000;
// Run the server
server.listen(APPSMITH_RTS_PORT, () => {
log.info(
`RTS version ${buildVersion} running at http://localhost:${APPSMITH_RTS_PORT}`,
);
});

export default server;
4 changes: 3 additions & 1 deletion app/client/packages/rts/src/ee/server.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
import "../ce/server.ts";
import server from "../ce/server";

export default server;
12 changes: 11 additions & 1 deletion app/client/packages/rts/src/server.ts
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
import "./ee/server.ts";
import server from "./ee/server";
import log from "loglevel";
import { VERSION as buildVersion } from "./version"; // release version of the api

const APPSMITH_RTS_PORT = process.env.APPSMITH_RTS_PORT || 8091;

server.listen(APPSMITH_RTS_PORT, () => {
log.info(
`RTS version ${buildVersion} running at http://localhost:${APPSMITH_RTS_PORT}`,
);
});

0 comments on commit c2bef37

Please sign in to comment.