A fast, Bun-powered API for checking and comparing web content using HTMLRewriter and Elysia.
- Check for presence of HTML elements
- Compare specific content within elements
- Built with Bun's native HTMLRewriter for performance
- OpenAPI documentation with Swagger generated by Elysia
- Error handling and validation
- Type-safe with TypeScript
# Install dependencies
bun install
Start the server in development mode:
bun run dev
Server runs at http://localhost:3000 for now.
POST /check
{
"url": "https://example.com",
"selector": "H1"
}
POST /compare
{
"url": "https://example.com",
"selector": "H2",
"expectedContent": "Expected text"
}
- 200: Success
- 400: Invalid URL
- 404: Element/Content not found
- 500: Internal server error
OpenAPI documentation available at /swagger
- Bun
- Elysia
- HTMLRewriter (Bun's native HTML parser)
- TypeScript
- Add rate limiting
- Implement authentication
- Add metrics collection
- Add request logging
- Add tests
- Separate classes into separate files
- SEparate utils into separate files