This file contains hidden or 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
| یک فروشگاه اینترنتی برام بساز با html/javascript | |
| تمش نارنجی قرمز دارک مود دکمه نئونی شیشه ای مدرن باشه | |
| برای فروشگاه کفش و لباس میخوام | |
| محصولات | |
| عنوان/توضیحات/قیمت/تصویر | |
| سبد خرید داشته باشه |
This file contains hidden or 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
| این پروژه php ببین | |
| یک فروشگاهه | |
| یک فایل html هم برات فرستادم | |
| یک فروشگاه اینترنتی برای کیف و کفش میخوام | |
| طبق منطق اون پروژه php فروشگاه کیف و کفشمو بسازش | |
| و درنهایت فایل کل پروژه رو به صورت فایل zip بهم بده | |
| سورس از: https://github.com/behnamonline/php-simple-shop |
This file contains hidden or 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
| app: { | |
| head: { | |
| script: [ | |
| { src: "https://telegram.org/js/telegram-web-app.js?64" } | |
| ] | |
| } | |
| } |
This file contains hidden or 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
| export function req<T = any>(url: string, options: any = {}): Promise<T> { | |
| return $fetch<T>(url, { | |
| ...options, | |
| headers: { | |
| ...options.headers, | |
| Authorization: `tma ${window.Telegram?.WebApp?.initData || ''}`, | |
| }, | |
| }) | |
| } |
This file contains hidden or 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
| import { createHmac, timingSafeEqual } from 'node:crypto' | |
| export function tgAuth(event: any, maxAge = 86400) { | |
| const auth = getHeader(event, 'authorization') || '' | |
| const initData = auth.startsWith('tma ') ? auth.slice(4) : '' | |
| const telegramBotToken = "YOUR_BOT_TOKEN" | |
| const fail = () => { | |
| throw createError({ statusCode: 403, statusMessage: 'Forbidden' }) | |
| } |
This file contains hidden or 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
Show hidden characters
| { | |
| "d1_databases":[ | |
| { | |
| "database_name": "your_database_name", | |
| "database_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", | |
| "binding": "db_link" | |
| } | |
| ] | |
| } |
This file contains hidden or 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
| import { myDB } from "./db"; | |
| export default defineEventHandler(async (e) => { | |
| const db = myDB(); | |
| return await db.sql` | |
| create table if not exists messages ( | |
| id integer primary key autoincrement, | |
| message text | |
| ) | |
| ` |
This file contains hidden or 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
| <script setup lang="ts"> | |
| const { data } = await useFetch('/api/hello'); | |
| </script> | |
| <template> | |
| <h1>Use API</h1> |
This file contains hidden or 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
| export default defineEventHandler(async (event) => { | |
| return { | |
| message: "hello I am api", | |
| status: 'ok', | |
| } | |
| }); |
This file contains hidden or 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
| export const myDB = () => { | |
| if (import.meta.dev) { | |
| return useDatabase('mainDB_local'); | |
| } | |
| return useDatabase('mainDB_cf'); | |
| }; |
NewerOlder