Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# simple-server

A minimal [Express.js](https://expressjs.com/) HTTP server that demonstrates basic routing, including a `GET` endpoint and a `PATCH` endpoint.

---

## Installation

```bash
npm install
```

---

## Usage

Start the server (uses [nodemon](https://nodemon.io/) for auto-restart on file changes):

```bash
npm start
```

The server listens on **port 7000** by default.

---

## File Descriptions

| File | Description |
|------|-------------|
| `index.js` | Main entry point. Creates the Express app, registers routes, and starts the server on port 7000. |
| `patchHandler.js` | Express router module that handles `PATCH /` requests. |
| `package.json` | Project metadata and dependency definitions (`express`, `nodemon`). |
| `test.txt` | A plain-text file containing numbers 1–20, used for testing file-serving or read operations. |

---

## API Endpoints

### `GET /`

Returns a plain-text greeting.

**Response:**
```
Hello world!
```

### `PATCH /`

Logs the incoming request. Handled by `patchHandler.js`.

---

## Project Structure

```
simple-server/
├── index.js # App entry point
├── patchHandler.js # PATCH route handler
├── package.json # Project configuration
└── test.txt # Sample text file (numbers 1–20)
```