Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ur-code-buddy/pondyvibes_backend


https://github.com/ur-code-buddy/pondyvibes_backend

apis backend cloudflare hono javascript

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# PondyVibes Backend

This is the backend for the PondyVibes application, built using the Hono framework, specifically designed for Cloudflare Workers.

## Overview

This backend provides the following functionalities:
- **CORS Middleware**: Applied globally to allow cross-origin requests.
- **Admin Login**: Verifies admin credentials stored in Cloudflare's KV storage.
- **Content Management**:
- Store content using a `POST` request with admin authentication.
- Retrieve stored content with a `GET` request.
- **Status Check**: Endpoint to check if the server is running.
- **Send Message**: Sends a booking request email with custom HTML formatting via the Resend API.

## Endpoints

- `GET /status`: Check server status.
- `GET /`: Base endpoint providing a simple message.
- `POST /store_content`: Stores content with admin authentication.
- `GET /get_content`: Retrieves stored content.
- `GET /login`: Verifies admin credentials.
- `POST /send_message`: Sends a formatted email using the Resend API.

## Why Hono?

Hono is used instead of Express due to its lightweight design, making it ideal for Cloudflare Workers. This enables faster response times and better performance on serverless environments.

## Environment Variables

- **USERS_KV**: Cloudflare KV namespace for storing admin credentials.
- **CONTENT_KV**: Cloudflare KV namespace for storing content.
- **Resend API Key**: `re_jhHk6Ar7_DxmMo34uAt1z2avpqbFzx6YJ` used for sending emails via Resend.

## Deployment

This backend is designed to be deployed on Cloudflare Workers.

## License

This project is licensed under the MIT License.