emptygif
ભાષા: ગુજરાતી

બધી ભાષાઓ અને ફ્રેમવર્ક

Fresh TypeScript

Fresh માટે TypeScript સ્નિપેટ, જે /pixel.gif પરની રિક્વેસ્ટનો જવાબ empty GIF થી આપે છે. GIF સ્ટાર્ટઅપ વખતે એક જ વાર ડિકોડ થાય છે.

Fresh TypeScript

ઇન્સ્ટૉલ
deno run -Ar jsr:@fresh/init
ફાઇલ
main.ts
ચલાવો
deno task dev
// main.ts - a programmatic route (Fresh 2)
import { App } from 'fresh';
import { decodeBase64 } from 'jsr:@std/encoding/base64';

const GIF = decodeBase64('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==');

export const app = new App()
  .get('/pixel.gif', () =>
    new Response(GIF, {
      headers: { 'Content-Type': 'image/gif', 'Cache-Control': 'no-store' },
    }))
  .fsRoutes();

અમે આ સ્નિપેટ ચલાવ્યો અને તેણે પરત કરેલા બાઇટની સરખામણી કરી.

ચકાસો

curl -sI http://localhost:8080/pixel.gif

સત્તાવાર સાઇટ: Fresh

TypeScript માં વધુ