generated from skills/copilot-codespaces-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
c4ff05a
commit b17569c
Showing
1 changed file
with
33 additions
and
0 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,33 @@ | ||
// Create web server | ||
// 1. Load express module | ||
// 2. Create web server | ||
// 3. Start server | ||
// 4. Create route | ||
// 5. Create function for route | ||
// 6. Start server | ||
// 7. Test in browser | ||
|
||
// 1. Load express module | ||
const express = require('express'); | ||
|
||
// 2. Create web server | ||
const server = express(); | ||
|
||
// 4. Create route | ||
// 5. Create function for route | ||
server.get('/', (req, res) => { | ||
res.send(` | ||
<form method="POST"> | ||
<input name="username" type="text"> | ||
<button>Submit</button> | ||
</form> | ||
`); | ||
}); | ||
|
||
// 6. Start server | ||
server.listen(3000, () => { | ||
console.log('Listening on port 3000'); | ||
}); | ||
|
||
// 7. Test in browser | ||
// http://localhost:3000/ |