This project is a simple web server built using Node.js and Express. It serves static files, logs access requests, and supports file uploads and downloads. The server logs each request to an access.log
file and prints request details to the console. It uses Multer for handling file uploads, storing them in the shared
directory while preserving the original filenames. The server listens on all network interfaces and dynamically determines the local IP address for wireless LAN connections.
public
directory.access.log
and prints them to the console./upload
, storing files in the shared
directory./download
, serving files from the shared
directory.Sure! Here are the steps and tools you need to download and set up your project as a beginner:
Node.js and npm: Node.js is a JavaScript runtime, and npm is the Node.js package manager. Download and install them from nodejs.org.
Visual Studio Code: A powerful code editor. Download and install it from code.visualstudio.com.
<repository-url>
with your actual repository URL):
git clone https://github.com/newnol/firstWebsite/
cd firstWebsite
npm install
npm run dev
http://localhost:3000
to see your website in action.npm run build
npm start
http://<local-ip-address>:3000
to access the server.Postman: A tool for testing APIs. Download and install it from postman.com.
Git: A version control system. Download and install it from git-scm.com.
Here’s a brief overview of the project structure:
access.log
package.json
public/
css/
global.css
styles.css
file.html
images/
index.html
server.js
shared/
Git-2.46.0-64-bit.exe
test.txt
npm install
npm run dev
npm run build
npm start
By following these steps, you should be able to set up and run your project successfully.