This project demonstrates how to set up a basic Node.js web server using Express.js and deploy it to a GitHub repository. The server renders student-specific data upon request.
- Node.js - JavaScript runtime for backend development
- Express.js - Web framework for Node.js
- Git - Version control system
- GitHub - Remote repository hosting
- Visual Studio Code - Code editor
- Command Line Interface (CLI) - For executing commands
Before implementing the server, ensure the development environment is properly configured.
- Visual Studio Code: Download and install from VS Code
- Node.js: Download and install from Node.js
- Git: Install from Git
- Open terminal and create a project directory:
mkdir SIT737-NodeServer cd SIT737-NodeServer - Initialize a Node.js project:
This generates
npm init -y
package.jsonfor dependency management.
npm install express- Inside the project folder, create a file named
server.js. - Add the following code:
const express = require('express'); const app = express(); const port = 3000; app.get('/', (req, res) => { res.send('Welcome to SIT737 Node.js Web Server!'); }); app.listen(port, () => { console.log(`Server running at http://localhost:${port}`); });
node server.jsOpen http://localhost:3000 in a browser to verify.
git init
git add .
git commit -m "Initial commit - Setting up Node.js web server"- Create a new repository on GitHub (e.g.,
sit737-2025-prac2p). - Link the local repository to GitHub:
git remote add origin https://github.com/himanshudhaka17/sit737-2025-prac2p.git git branch -M main git push -u origin main
This project successfully demonstrates the setup and deployment of a basic Node.js web server using Express.js. The repository is now live on GitHub for future development and collaboration.
GitHub Repository: https://github.com/himanshudhaka17/sit737-2025-prac2p


