-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
24 additions
and
14 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 |
---|---|---|
@@ -1,12 +1,5 @@ | ||
import express from 'express' | ||
import vike from 'vike-node/connect' | ||
import { connectToWeb } from 'vike-node' | ||
import app from '../server/index.js' | ||
|
||
export default startServer() | ||
|
||
function startServer() { | ||
const app = express() | ||
app.use(vike({ static: false })) | ||
const port = process.env.PORT || 3000 | ||
app.listen(port, () => console.log(`Server running at http://localhost:${port}`)) | ||
return app | ||
} | ||
// Web request handlers support streaming by default on Vercel | ||
export const GET = connectToWeb(app) |
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,11 +1,12 @@ | ||
import express from 'express' | ||
import vike from 'vike-node/connect' | ||
|
||
startServer() | ||
export default startServer() | ||
|
||
function startServer() { | ||
const app = express() | ||
app.use(vike()) | ||
const port = process.env.PORT || 3000 | ||
app.listen(port, () => console.log(`Server running at http://localhost:${port}`)) | ||
return app | ||
} |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { connectToWeb } from './runtime/adapters/connectToWeb.js' | ||
export { createServerResponse } from './runtime/adapters/createServerResponse.js' |
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