Prerequisites
Before you begin, ensure you have the following installed:- Bun (latest version)
- A code editor (VS Code, Cursor, etc.)
- Git
Installation
Install dependencies
Install all required packages using Bun:This will install the following dependencies:
hono- Fast web framework for routingrss-parser- RSS feed parsing library@types/bun- TypeScript types for Bun
Project Structure
The project follows a simple, modular structure:Key Files
server.ts
server.ts
The main application server using Hono framework:
- Defines routes for healthcheck and RSS feed processing
- Exports the app for Vercel deployment
- Located at:
server.ts:1
rss-handler.ts
rss-handler.ts
Core RSS feed processing logic:
- Fetches Shopify changelog RSS feed
- Filters new items since last check
- Formats and sends messages to Google Chat
- Located at:
rss-handler.ts:1
vercel.json
vercel.json
Deployment configuration:
- Defines cron job to run daily at midnight UTC
- Triggers
/get-rss-feedendpoint - Located at:
vercel.json:1
Running the Development Server
Start the development server with hot reloading:bun run --hot server.ts, which:
- Starts the Hono server
- Enables hot module reloading (automatically restarts on file changes)
- Makes the API available at
http://localhost:3000
Available Endpoints
Once the server is running, you can access:Healthcheck
RSS Feed Handler
Development Workflow
Make changes to the code
Edit files in your code editor. The server will automatically reload when you save changes.
Test your changes
Use curl, Postman, or your browser to test the endpoints.See the Testing Guide for detailed testing instructions.
TypeScript Configuration
The project uses strict TypeScript settings for better code quality:- Target: ESNext (latest JavaScript features)
- Module: Preserve (for Bun’s bundler)
- Strict mode: Enabled
- JSX: react-jsx (if needed for future UI components)
Bun has built-in TypeScript support, so no separate compilation step is needed.
Troubleshooting
Port already in use
Port already in use
If port 3000 is already in use, Bun will automatically try the next available port. Check the console output for the actual port number.
WEBHOOK_URL not set error
WEBHOOK_URL not set error
Make sure you’ve created a
.env file with a valid WEBHOOK_URL. The application will throw an error if this is missing when trying to send messages.Module not found errors
Module not found errors
Run
bun install again to ensure all dependencies are properly installed.Next Steps
- Learn how to test the application
- Deploy to Vercel
- Customize the RSS handler logic