kin-labs / kinetic

MIT License
40 stars 24 forks source link

Add a way to redirect to https on production. #2

Closed beeman closed 2 years ago

beeman commented 2 years ago

In the Kin Devportal we use https://npm.im/redirect-ssl , but this triggers a TypeScript error. https://github.com/kin-labs/kin-devportal/blob/main/apps/api/src/main.ts#L6

In the Kin Data repo we use a vendored-in fork. https://github.com/kin-labs/kin-data/blob/main/apps/api/src/main.ts#L11 https://github.com/kin-labs/kin-data/blob/main/libs/api/core/util/src/lib/helpers/redirect-ssl.helper.ts

We should probably standardize between the two, and apply that to Mogami.

I think either:

beeman commented 2 years ago

@RamirezAlex it's probably good to make Mogami auto-switch to HTTPS, I'm curious to hear what you think is a good solution here.

beeman commented 2 years ago

Turns out that the key was in the TypeScript configuration:

https://github.com/kin-labs/mogami/pull/62/files#diff-422316420dd93b13739ae5cb2d437e4a41b84b79812049ee22c26645d73bf5aeR7

Setting "esModuleInterop": true made the errors go away and it now works as expected.