kingworld icon indicating copy to clipboard operation
kingworld copied to clipboard

Allow use of dynamic ports?

Open OmgImAlexis opened this issue 1 year ago • 3 comments

I was hoping something like this could be added?

import KingWorld from 'kingworld'

const server = new KingWorld()
	.get('/', () => 'Hello KingWorld')
	.listen(0)
	 
console.log('🦊 KINGWORLD is running at :%s', server.port)

This would also help in this case.

import KingWorld from 'kingworld'

const server = new KingWorld()
	.get('/', () => 'Hello KingWorld')
	.listen(process.env.PORT ?? 0)

console.log('🦊 KINGWORLD is running at :%s', server.port)

OmgImAlexis avatar Nov 22 '22 14:11 OmgImAlexis