async function AboutMe() {
const name = 'Muhammad Ihsan';
}
A Pen by Robin Selmer on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function readRequestBody(request) { | |
const { headers } = request; | |
const contentType = headers.get('content-type') || ''; | |
if (contentType.includes('application/json')) { | |
return JSON.stringify(await request.json()); | |
} else if (contentType.includes('form')) { | |
const formData = await request.formData(); | |
const body = {}; | |
for (const entry of formData.entries()) { | |
body[entry[0]] = entry[1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function handleRequest(request) { | |
let ms = Date.now() | |
let add = new Date(ms + 604800000) | |
const url = new URL(request.url) | |
url.hostname = "ihsangan.github.io" | |
let req = new Request(url, request) | |
let response = await fetch(req, { | |
cf: { | |
minify: { javascript: true, css: true, html: true }, | |
cacheTtl: 86400, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function handleRequest(request) { | |
const url = new URL(request.url); | |
// change the hostname | |
url.hostname = "rule34.paheal.net"; | |
let req = new Request(url, request); | |
const response = await fetch(req, { | |
// RequestInitCfProperties | |
// see: https://developers.cloudflare.com/workers/runtime-apis/request#requestinitcfproperties | |
cf: { | |
minify: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function handleRequest(request) { | |
const url = new URL(request.url) | |
// change the hostname | |
url.hostname = "example.domain.com" | |
let req = new Request(url, request) | |
let response = await fetch(req, { | |
// RequestInitCfProperties | |
// see: https://developers.cloudflare.com/workers/runtime-apis/request#requestinitcfproperties | |
cf: { | |
minify: { javascript: true, css: true, html: true }, |
I hereby claim:
- I am ihsangan on github.
- I am ihsangans (https://keybase.io/ihsangans) on keybase.
- I have a public key ASDwLPordAgg0m1gJhVkbd0OZlyi2lWV55m4HuB5akUCtQo
To claim this, I am signing this object: