Skip to content

Instantly share code, notes, and snippets.

View Lissy93's full-sized avatar
:bowtie:
Stuck in an infinite loop

Alicia Sykes Lissy93

:bowtie:
Stuck in an infinite loop
View GitHub Profile
@Lissy93
Lissy93 / open-ai-assistant.js
Last active February 29, 2024 10:26
A REST API for fetching the repsponse from a custom GPT assistant via the OpenAI API. Runs as a Cloudflare Worker.
/**
* A REST API for fetching the repsponse from
* a custom GPT assistant via the OpenAI API
* Deployed as a simple Cloudflare Worker
* Licensed under MIT (C) Alicia Sykes 2024
*/
(() => {
addEventListener("fetch", (event) => {
event.respondWith(handleRequest(event.request));
/**
* A quick and simple JS WHOIS lookup to return JSON
* Docs and usage instructions are below...
**/
import * as whois from 'whois';
import * as changeCase from 'change-case';
import { decodeEntity } from 'html-entities';
const DELIMITER = ':';