https://github.com/pabitra-33/helloworld_node
https://github.com/pabitra-33/helloworld_node
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pabitra-33/helloworld_node
- Owner: Pabitra-33
- Created: 2024-03-14T15:21:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-10T11:33:39.000Z (over 1 year ago)
- Last Synced: 2024-05-10T12:46:09.810Z (over 1 year ago)
- Language: JavaScript
- Size: 971 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HelloWorld_Node
Developed one server in Node.js that listens on a specific port and responds with "Hello, world!" as output.You can follow these steps to create one server in nodejs :
. Install Node.js :
If you haven't already, download and install Node.js from the official website: Node.js.. Create a new directory for your project:
Open your terminal or command prompt and create a new directory where you want to create your Node.js server.
mkdir my-server
cd my-server. Initialize a new Node.js project:
Run the following command to create a package.json file, which will hold information about your project and its dependencies.
npm init -y. Install Express.js:
Express.js is a popular web framework for Node.js. It simplifies the process of creating web servers.
npm install express. Create your server file:
Inside your project directory, create a new file named server.js (or any other name you prefer).. Run your server:
Save the server.js file, then run the following command in your terminal or command prompt to start the server:
node server.js. Access your server:
Open a web browser and navigate to http://localhost:8000. You should see "Hello, world!" displayed in the browser window.That's it! We've created a simple Node.js server that listens on port 8000 and responds with "Hello, world!" when accessed.