Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTTPS option #19

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

CheyenneForbes
Copy link

We're currently testing out DuckyAPI on Kubernetes and we have a practice of using HTTPS even in internal cluster communications. Others might find this helpful for different reasons.

We're currently testing out DuckyAPI on Kubernetes and we have a practice of using HTTPS even in internal cluster communications. Others might find this helpful for different reasons.
Copy link
Owner

@louis-lau louis-lau left a comment

Choose a reason for hiding this comment

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

Hi @CheyenneForbes, thank you very much for the PR! I have some feedback. Additionally, could you add these values to the example.env? They should be commented out as they're optional.

I hadn't really set this project up for contributions yet, sorry about that. In a second CLA assistant should ask you to sign a CLA. It just makes sure that I retain full rights to the entirety of this app :). Thanks!

@IsOptional()
@IsNotEmpty()
@IsString()
TLS_KEY_PATH: string
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
TLS_KEY_PATH: string
TLS_KEY_PATH?: string

@IsOptional()
@IsNotEmpty()
@IsString()
TLS_CERT_PATH: string
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
TLS_CERT_PATH: string
TLS_CERT_PATH?: string

const server = express.default()
const app = await NestFactory.create(
AppModule,
new ExpressAdapter(server)
Copy link
Owner

Choose a reason for hiding this comment

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

The only reason to do it this way I can see from the documention if for starting multiple servers at the same time (for example an http server next to an https server), which is not something that's happening right now. Is there a reason you did it this way as opposed to the standard nestjs config?

Comment on lines +69 to +70
const https = require('https')
const fs = require('fs')
Copy link
Owner

Choose a reason for hiding this comment

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

Please make these import statements at the top of the file instead of requires.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants