Iniciar sesión
Más
Es
COP
// app/page.tsx import { Suspense } from "react" import { db } from "@/lib/db" export const revalidate = 60 async function getPlanes() { const rows = await db.query( "select slug, precio from planes" ) return rows.map(toPlan) } export default async function Page() { const planes = await getPlanes() return ( <main className="grid gap-6"> <Suspense fallback={<Skeleton />}> <PlanList items={planes}/> </Suspense> </main> ) } // deploy: git push && npm run build export const dynamic = "force-static"// app/page.tsx import { Suspense } from "react" import { db } from "@/lib/db" export const revalidate = 60 async function getPlanes() { const rows = await db.query( "select slug, precio from planes" ) return rows.map(toPlan) } export default async function Page() { const planes = await getPlanes() return ( <main className="grid gap-6"> <Suspense fallback={<Skeleton />}> <PlanList items={planes}/> </Suspense> </main> ) } // deploy: git push && npm run build export const dynamic = "force-static"
// app/api/deploy/route.ts import { NextResponse } from "next/server" import { build, restart } from "@/lib/pm2" export async function POST(req: Request) { const { repo, branch } = await req.json() await exec(`git pull origin ${branch}`) const out = await build({ cwd: repo }) if (!out.ok) { return NextResponse.json( { error: out.log }, { status: 500 } ) } await restart("mi-app") return NextResponse.json({ ok: true }) } // listo · https://tudominio.co// app/api/deploy/route.ts import { NextResponse } from "next/server" import { build, restart } from "@/lib/pm2" export async function POST(req: Request) { const { repo, branch } = await req.json() await exec(`git pull origin ${branch}`) const out = await build({ cwd: repo }) if (!out.ok) { return NextResponse.json( { error: out.log }, { status: 500 } ) } await restart("mi-app") return NextResponse.json({ ok: true }) } // listo · https://tudominio.co
Feria de Hosting 2026 — precios especiales y dominios con descuento por tiempo limitado