Skip to content

Fetch alternative for Deno that forwards calls through a thingproxy server.

License

Notifications You must be signed in to change notification settings

zinthose/thingproxy-deno

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Phetch a resource from the network through a running thingproxy (Docker Image Available). It returns a Promise that resolves to the Response to that request, whether it is successful or not.

Syntax is identical to Fetch

Why?

This method was created to act as a temporary workaround to the Deno TLS protocol issue: "error trying to connect: tls handshake eof #6427"

Setting of thingproxy is done via the .env file.

Example .env

THINGPROXY=http://localhost:3000/fetch/

Example Code

import { phetch } from "https://raw.githubusercontent.com/zinthose/thingproxy-deno/master/mod.ts";

const response = await phetch("https://postman-echo.com/get?foo1=bar1&oo2=bar2"); 
console.log(response.status); 
// e.g. 200 console.log(response.statusText); 
// e.g. "OK" const jsonData = await response.json();

About

Fetch alternative for Deno that forwards calls through a thingproxy server.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published