Skip to content

preciousadeyemi78/basic-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

basic-nodejs — Static Website & API Demo

Node.js License

A simple Node.js project demonstrating how to serve static HTML, CSS, images, and JSON API endpoints without any frameworks. Great for learning, demos, or lightweight static sites!


📑 Table of Contents


🚀 Features

  • Serves static HTML, CSS, and images from the public/ directory
  • Five routes: /, /about (JSON), /api/data (JSON), /gallery (HTML), /contact (HTML)
  • Simple, framework-free Node.js HTTP server
  • Example of JSON API endpoints

🗂 Project Structure

.
├── public/
│   ├── index.html
│   ├── about.html
│   ├── gallery.html
│   ├── contact.html
│   ├── style.css
│   └── images/
│       ├── sample.jpg
│       └── sample2.jpg
└── server.js

⚡ Quick Start

  1. Clone the repo:
    git clone https://github.com/preciousadeyemi78/basic-nodejs.git
    cd basic-nodejs
  2. Add images: Place your images in public/images/ as sample.jpg and sample2.jpg (or update HTML to match your filenames).
  3. Run the server:
    node server.js
  4. Visit in your browser:

🌐 Available Routes

Route Type Description
/ HTML Home page
/about JSON Project info as JSON
/api/data JSON Sample API data
/gallery HTML Image gallery
/contact HTML Contact info
/style.css CSS Stylesheet
/images/sample.jpg Image Example image

🖼 Screenshots

Add screenshots of your site here for a better demo!


🤝 Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.


📄 License

MIT

About

This repo is on coding basic nodejs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors