A replacement for a simple express app that accepts a URL on its /
endpoint
and returns the page's source code to the requesting browser.
HTTP Type
val.# Start local development server ./dev.sh local # or deno task local-dev # Deploy to Val Town ./dev.sh push # or deno task push
./dev.sh dev
- Start Val Town development server./dev.sh local
- Start local development server (port 3001)./dev.sh push
- Format, check, and deploy to Val Town./dev.sh status
- Check project status./dev.sh logs
- View logs./dev.sh help
- Show all commandsTest locally: http://localhost:3001?url=https://example.com
/
endpoint with no parameters shows a simple HTML form for entering a
URLurl
query parameter, it returns the source code of that
page as plain textThe original Express app was a simple form that accepted a URL and returned the source code. The new implementation:
The original application (available in the glitch
branch) was a Node.js/Express app with:
server.js
) with a single GET route that:
node-fetch
to retrieve and return page source when a URL was providedviews/index.html
) with:
public/style.css
)The Val.town migration maintains the same core functionality while modernizing the implementation to use Deno and Val.town's HTTP handler format.
GET /?url=https://example.com
Returns: The source code of the specified URL as plain text