Skip to content

Instantly share code, notes, and snippets.

@deguchi
Last active March 31, 2021 03:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deguchi/59333b427a56d4a102ccbe49a60266df to your computer and use it in GitHub Desktop.
Save deguchi/59333b427a56d4a102ccbe49a60266df to your computer and use it in GitHub Desktop.
addEventListener("fetch", (event) => {
const url = 'https://unitrad.calil.jp/v1/search?free=%E9%AC%BC%E6%BB%85%E3%81%AE%E5%88%83&region=openbd-future'
fetch(url).then(r => r.json()).then(data => {
const response = new Response(JSON.stringify(data), {
headers: { "content-type": "application/json; charset=utf-8" },
});
event.respondWith(response);
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment