-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] allow node adapter to configure listen path (#2048)
- Loading branch information
Showing
3 changed files
with
16 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sveltejs/adapter-node': patch | ||
--- | ||
|
||
[feat] allow node adapter to configure listen path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
// TODO hardcoding the relative location makes this brittle | ||
import { init, render } from '../output/server/app.js'; // eslint-disable-line import/no-unresolved | ||
import { host, port } from './env.js'; // eslint-disable-line import/no-unresolved | ||
import { path, host, port } from './env.js'; // eslint-disable-line import/no-unresolved | ||
import { createServer } from './server'; | ||
|
||
init(); | ||
|
||
const instance = createServer({ render }).listen(port, host, () => { | ||
console.log(`Listening on ${host}:${port}`); | ||
const instance = createServer({ render }); | ||
|
||
const listenOpts = { path, host, port }; | ||
instance.listen(listenOpts, () => { | ||
console.log(`Listening on ${path ? path : host + ':' + port}`); | ||
}); | ||
|
||
export { instance }; |