Content-Length: 270858 | pFad | http://github.com/ajmalfaris11/node-server-basics

C0 GitHub - ajmalfaris11/node-server-basics: A Node.js project for studying server creation and management using only Node.js and its core modules, without any external libraries
Skip to content

A Node.js project for studying server creation and management using only Node.js and its core modules, without any external libraries

Notifications You must be signed in to change notification settings

ajmalfaris11/node-server-basics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node Server Basics

This project is a simple HTTP server built with Node.js using only core modules, without any external libraries except for Nodemon (installed for development convenience). The server responds to specific routes with custom messages and demonstrates fundamental server creation and route handling in Node.js.

Features

  • Root Route ("/"): Returns a welcome message when accessed via a GET request.
  • Add Route ("/add"): Returns a message indicating the add page for a GET request.
  • Admin Route ("/admin"): Returns a message indicating the admin page for a GET request.

Getting Started

Prerequisites

Ensure that you have Node.js installed on your machine.

Installation

  1. Clone the repository:
    git clone (https://github.com/ajmalfaris11/node-server-basics.git)
  2. Navigate to the project directory:
    cd <project-directory>
  3. Initialize the project with npm and install Nodemon:
    npm init -y
    npm install nodemon --save-dev

Usage

To start the server with Nodemon for auto-restarts:

npx nodemon <your-main-server-file>.js

Alternatively, you can start the server with:

node <your-main-server-file>.js

The server will be accessible at http://localhost:3200.

Server Routes

Route Method Description
/ GET Returns a welcome message
/add GET Returns the add page message
/admin GET Returns the admin page message

Project Summary

This project showcases the following:

  • Basic HTTP server creation using Node.js.
  • Handling specific routes and responding with custom messages.
  • Nodemon setup for development ease, allowing for automatic restarts upon file changes.

About

A Node.js project for studying server creation and management using only Node.js and its core modules, without any external libraries

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/ajmalfaris11/node-server-basics

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy