An open API service indexing awesome lists of open source software.

https://github.com/noahwillson/butter-framework

Butter is Nodejs Framework that is provide basic auth and user management functionalities
https://github.com/noahwillson/butter-framework

framework http nodejs proxy

Last synced: 7 months ago
JSON representation

Butter is Nodejs Framework that is provide basic auth and user management functionalities

Awesome Lists containing this project

README

          

# HTTP Server with Authentication and Post Management

This project is a simple HTTP server built using a custom framework called `Butter`. It provides basic authentication, user management, and post management functionalities. The server is designed to handle JSON-based API requests and serve static files for a front-end application.

## Features

- **User Authentication**:

- Login with username and password to receive a session token.
- Logout to invalidate the session token.

- **User Management**:

- Retrieve user information.
- Update user details (username, name, and optionally password).

- **Post Management**:

- Retrieve a list of posts with author information.
- Create new posts.

- **Static File Serving**:

- Serve `index.html`, `styles.css`, and `scripts.js` for the front-end.

- **Middleware**:
- JSON body parsing for API requests.
- Authentication middleware to protect specific routes.

## API Endpoints

### Authentication Routes

- **POST `/api/login`**
Logs in a user and returns a session token.
**Request Body**:
```json
{
"username": "liam23",
"password": "string"
}
```