Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)48k Β· #4507

eas-hosting

Fungsinya

EAS Hosting adalah layanan berbayar yang menerbitkan web app dan API routes (program kecil yang merespons permintaan) Anda di infrastruktur Expo. Layanan ini memungkinkan Anda membuat fungsi yang perlu berjalan di server, seperti akses database atau penggunaan secret key.

Kapan dipakai

  • βœ“Saat Anda perlu menyimpan informasi rahasia (seperti password database) yang tidak boleh muncul di kode aplikasi Anda.
  • βœ“Untuk menjalankan operasi pada database langsung dari aplikasi Anda.
  • βœ“Untuk membuat 'perantara' yang berkomunikasi dengan layanan online lain, sekaligus menyembunyikan access key Anda.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/eas-hosting/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/eas-hosting/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBagaimana cara membuat aplikasi saya bisa mengakses database secara aman?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Anda menulis potongan kode kecil yang disebut 'API routes' di folder tertentu dalam proyek Anda. Ketika aplikasi membutuhkan sesuatu dari server, aplikasi mengirim permintaan ke route tersebut. Route itu lalu memproses informasinya dan mengembalikan hasilnya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

EAS Hosting

EAS service - costs apply. EAS Hosting is a paid Expo Application Services product with free-tier limits; production deploys use your plan's request and bandwidth allowance. See https://expo.dev/pricing. Authoring API routes and exporting the web bundle are free and open source, and you can self-host the exported server output instead of EAS Hosting.

EAS Hosting deploys your Expo web app and API routes to Expo's managed edge (Cloudflare Workers). Export the web bundle with npx expo export -p web and ship it with eas deploy - the same command deploys any Expo Router API routes bundled alongside it. This skill covers deploying a website, authoring API routes, and the hosting runtime; see the Deployment section below for the deploy workflow.

When to Use API Routes

Use API routes when you need:

  • Server-side secrets β€” API keys, database credentials, or tokens that must never reach the client
  • Database operations β€” Direct database queries that shouldn't be exposed
  • Third-party API proxies β€” Hide API keys when calling external services (OpenAI, Stripe, etc.)
  • Server-side validation β€” Validate data before database writes
  • Webhook endpoints β€” Receive callbacks from services like Stripe or GitHub
  • Rate limiting β€” Control access at the server level
  • Heavy computation β€” Offload processing that would be slow on mobile

When NOT to Use API Routes

Avoid API routes when:

  • Data is already public β€” Use direct fetch to public APIs instead
  • No secrets required β€” Static data or client-safe operations
  • Real-time updates needed β€” Use WebSockets or services like Supabase Realtime
  • Simple CRUD β€” Consider Firebase, Supabase, or Convex for managed backends
  • File uploads β€” Use direct-to-storage uploads (S3 presigned URLs, Cloudflare R2)
  • Authentication only β€” Use Clerk, Auth0, or Firebase Auth instead

File Structure

API routes live in the app directory with +api.ts suffix:

app/
  api/
    hello+api.ts          β†’ GET /api/hello
    users+api.ts          β†’ /api/users
    users/[id]+api.ts     β†’ /api/users/:id
  (tabs)/
    index.tsx

Basic API Route

// app/api/hello+api.ts
export function GET(request: Request) {
  return Response.json({ message: "Hello from Expo!" });
}

HTTP Methods

Export named functions for each HTTP method:

// app/api/items+api.ts
export function GET(request: Request) {
  return Response.json({ items: [] });
}

export async function POST(request: Request) {
  const body = await request.json();
  return Response.json({ created: body }, { status: 201 });
}

export async function PUT(request: Request) {
  const body = await request.json();
  return Response.json({ updated: body });
}

export async function DELETE(request: Request) {
  return new Response(null, { status: 204 });
}

Dynamic Routes

// app/api/users/[id]+api.ts
export function GET(request: Request, { id }: { id: string }) {
  return Response.json({ userId: id });
}

Request Handling

Query Parameters

export function GET(request: Request) {
  const url = new URL(request.url);
  const page = url.searchParams.get("page") ?? "1";
  const limit = url.searchParams.get("limit") ?? "10";

  return Response.json({ page, limit });
}

Headers

export function GET(request: Request) {
  const auth = request.headers.get("Authorization");

  if (!auth) {
    return Response.json({ error: "Unauthorized" }, { status: 401 });
  }

  return Response.json({ authenticated: true });
}

JSON Body

export async function POST(request: Request) {
  const { email, password } = await request.json();

  if (!email || !password) {
    return Response.json({ error: "Missing fields" }, { status: 400 });
  }

  return Response.json({ success: true });
}

Environment Variables

Use process.env for server-side secrets:

// app/api/ai+api.ts
export async function POST(request: Request) {
  const { prompt } = await request.json();

  const response = await fetch("https://api.openai.com/v1/chat/completions", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${process.env.OPENAI_API_KEY}`,
    },
    body: JSON.stringify({
      model: "gpt-4",
      messages: [{ role: "user", content: prompt }],
    }),
  });

  const data = await response.json();
  return Response.json(data);
}

Set environment variables:

…

Pertanyaan umum

Apa itu 'API routes'?

Itu adalah program kecil di dalam aplikasi Anda yang berjalan di server. Program ini menerima permintaan (misalnya 'berikan data pengguna X') lalu merespons dengan informasi yang diminta atau menjalankan suatu aksi.

Apakah saya bisa menggunakannya secara gratis?

EAS Hosting memiliki paket gratis dengan batasan tertentu. Untuk penggunaan yang lebih berat, mungkin ada biaya. Membuat API routes dan mengekspor kode agar bisa dijalankan di tempat lain itu gratis.

Bagaimana cara kerja EAS Hosting?

Layanan ini menggunakan infrastruktur Cloudflare Workers untuk menjalankan API routes dan web app Anda. Anda men-deploy kode dengan perintah 'eas deploy'.

Detail

Deskripsi asli dari pembuat

Curated upstream guidance for Eas Hosting; use when the workflow matches the user goal.

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#4507
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa