npm.io
1.1.3 โ€ข Published 3 years ago

cloudflare-framework

Licence
ISC
Version
1.1.3
Deps
0
Size
20 kB
Vulns
0
Weekly
0

cloudflare-framework

ๅฐ cloudflare ๅธธ็”จๅŠŸ่ƒฝ็š„ๅฐ่ฃ~

Getting Started

่ฏฆ่งcloudflareๅฎ˜็ฝ‘ -> Wrangler

# ๅฎ‰่ฃ cloudflare-framework 
npm install cloudflare-framework

Developing

examples ไธญๅผ•ๅ…ฅไบ†ๅ„ไธช็คบไพ‹๏ผŒไบฆๅฏๅˆ ้™คๆ‰€ๆœ‰ไปฃ็ ็ผ–ๅ†™่‡ชๅทฑ็š„้€ป่พ‘ใ€‚

import { App, type Context } from 'cloudflare-framework';

const app = new App();

app.use(async (ctx: Context) => {

    const prop = await ctx.toProp();
    console.log('็•ถๅ‰่ซ‹ๆฑ‚ๅƒๆ•ธ', prop)
    
    // return ็š„ๆ•ฐๆฎๅฐ†่พ“ๅ‡บๅˆฐๆต่งˆๅ™จ
    return 'hello world';
});


// ๆœ€ๅŽ้œ€่ฆๅฐ† ๅฎžไพ‹ๅฏผๅ‡บ
export default app;

Keywords