Skip to content

Commit

Permalink
fixup! feat: provide deploy-url as runtime property
Browse files Browse the repository at this point in the history
  • Loading branch information
dhhyi committed Mar 20, 2021
1 parent 6037ecb commit 0876388
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 5 additions & 3 deletions server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ global['navigator'] = win.navigator;
// tslint:enable:no-string-literal
*/
// The Express app is exported so that it can be used by serverless Functions.
// not-dead-code
export function app() {
const logging = /on|1|true|yes/.test(process.env.LOGGING?.toLowerCase());

Expand Down Expand Up @@ -76,7 +77,7 @@ export function app() {
if (logging) {
server.use(
require('morgan')('tiny', {
skip: req => req.originalUrl.startsWith('/INTERSHOP/static'),
skip: (req: express.Request) => req.originalUrl.startsWith('/INTERSHOP/static'),
})
);
}
Expand Down Expand Up @@ -143,8 +144,9 @@ export function app() {

const icmProxy = proxy(ICM_BASE_URL, {
// preserve original path
proxyReqPathResolver: req => req.originalUrl,
proxyReqOptDecorator: options => {
proxyReqPathResolver: (req: express.Request) => req.originalUrl,
// tslint:disable-next-line: no-any
proxyReqOptDecorator: (options: any) => {
if (process.env.TRUST_ICM) {
// https://github.com/villadora/express-http-proxy#q-how-to-ignore-self-signed-certificates-
options.rejectUnauthorized = false;
Expand Down
4 changes: 4 additions & 0 deletions src/typings.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/* SystemJS module definition */
declare var module: NodeModule;

declare module 'express-http-proxy';

declare module 'express-robots-txt';

interface NodeModule {
id: string;
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"outDir": "./node_modules/.out-tsc/all",
"types": ["jest", "jest-extended", "node"]
},
"include": ["src/**/*.ts", "projects/**/*.ts"]
"include": ["src/**/*.ts", "projects/**/*.ts", "server.ts", "src/**/*.d.ts"]
}

1 comment on commit 0876388

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Azure Demo Servers are available:

Please sign in to comment.