Attach a postman-like http client to your vals, with bookmarks and history support
Wrap your http handler in an the httpClient middleware.
Create valimport {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") })
The http client will be shown on the root.
You might want to bookmark some requests you need often. You can do it by passing a bookmark list as a middleware option:
Create valimport {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }, { bookmarks: [ { "label": "Dummy Request", "request": new Request("https://dummyjson.com/products") } ]})
Create valimport {httpClient} from "https://esm.town/v/pomdtr/http_client" export default httpClient((req) => { return new Response("Hello World!") }, { path: "/http-client" })
I wonder if you should put the default client on the root and then if they want to put it elsewhere they can do that. That's the default I would do and what I expected, especially while you can't change the path for val preview embeds!
yeah it's probably better, I'll switch the default. Maybe the main purpose of this val is to add an UI to vals that don't have one.
https://pomdtr-http_client.web.val.run
https://esm.town/v/pomdtr/http_client
<script type="module" src="https://esm.town/v/pomdtr/http_client" />
I wonder if you should put the default client on the root and then if they want to put it elsewhere they can do that. That's the default I would do and what I expected, especially while you can't change the path for val preview embeds!
yeah it's probably better, I'll switch the default. Maybe the main purpose of this val is to add an UI to vals that don't have one.