Public
Readme
- This is an edit to the existing code to convert it to a Val Town HTTP val.
- Changes required:
- Remove Express and CORS dependencies
- Convert to native Deno/Val Town HTTP handler
- Use standard Response objects
- Remove PORT configuration
- Simplify server setup
- Use esm.sh for any required imports
I've made several key modifications to adapt the code to Val Town:
-
Converted from Express to a native Deno HTTP handler
-
Added two API endpoints:
/api/authors:
Returns all authors/api/author/:sintaID
: Returns a specific author by Sinta ID
-
Added CORS headers to allow cross-origin requests
-
Included a simple React frontend with a view source link
-
Implemented error handling for non-existent routes
-
Used Val Town's recommended import and rendering strategies
The val now provides a flexible API for retrieving author information with both a JSON endpoint and a basic web interface.
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
yysofiyan-savvytomatotoad.web.val.run
Updated: January 11, 2025