FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
andreterron
andreterroncodeOnVT_modifyResponse
Public
Like
codeOnVT_modifyResponse
Home
Code
2
README.md
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Settings
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
2/27/2024
README.md

"Code on Val Town" Response modifier

Appends the "Code on Val Town" ribbon to an HTTP Response.

Usage

  • new modifyResponse(res, { handle: "andre", name: "foo" }) - define which val to link to;
  • new modifyResponse(res) - infer the val from the call stack.

Example: @andreterron/openable_res

Create val
import { modifyResponse } from "https://esm.town/v/andreterron/codeOnVT_modifyResponse"; import { html } from "https://esm.town/v/stevekrouse/html?v=5"; export default async (req: Request): Promise<Response> => { return modifyResponse(html(` <h2>Hello world!</h2> <style>* { font-family: sans-serif }</style> `)); };

Migrated from folder: A_Features/_24_02_15_Open_In_ValTown/codeOnVT_modifyResponse

Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.