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
846e823
commit dc88da0
Showing
4 changed files
with
73 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 @@ | ||
// Create a web server |
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,41 @@ | ||
# my-web-server/my-web-server/README.md | ||
|
||
# My Web Server | ||
|
||
This project sets up a basic web server using Node.js. It serves as an entry point for handling HTTP requests and responses. | ||
|
||
## Getting Started | ||
|
||
To get a local copy up and running, follow these steps: | ||
|
||
1. Clone the repository: | ||
``` | ||
git clone https://github.com/yourusername/my-web-server.git | ||
``` | ||
|
||
2. Navigate to the project directory: | ||
``` | ||
cd my-web-server | ||
``` | ||
|
||
3. Install the dependencies: | ||
``` | ||
npm install | ||
``` | ||
|
||
4. Start the server: | ||
``` | ||
npm start | ||
``` | ||
|
||
## Usage | ||
|
||
Once the server is running, you can access it at `http://localhost:3000`. You can modify the request handling in `src/server.js` to suit your needs. | ||
|
||
## Contributing | ||
|
||
Contributions are welcome! Please feel free to submit a pull request or open an issue. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License. |
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,14 @@ | ||
{ | ||
"name": "my-web-server", | ||
"version": "1.0.0", | ||
"description": "A basic web server using Node.js", | ||
"main": "src/server.js", | ||
"scripts": { | ||
"start": "node src/server.js" | ||
}, | ||
"dependencies": { | ||
"express": "^4.17.1" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |
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,17 @@ | ||
// Import the http module | ||
const http = require('http'); | ||
|
||
// Create a web server | ||
const server = http.createServer((req, res) => { | ||
res.statusCode = 200; | ||
res.setHeader('Content-Type', 'text/plain'); | ||
res.end('Hello, World!\n'); | ||
}); | ||
|
||
// Define the port | ||
const PORT = process.env.PORT || 3000; | ||
|
||
// Start the server | ||
server.listen(PORT, () => { | ||
console.log(`Server running at http://localhost:${PORT}/`); | ||
}); |