Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Revert api inside docs to make it backward compatible with CLI

Jakub Novak27d592d94bef
diff --git a/apps/docs/src/app/(dashboard)/api/layout.tsx b/apps/docs/src/app/(dashboard)/api/layout.tsx
deleted file mode 100644
index 1a4ebc7a5..000000000
--- a/apps/docs/src/app/(dashboard)/api/layout.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import { Metadata } from 'next'
-
-export const metadata: Metadata = {
- title: {
- template: '%s - E2B',
- default: 'E2B - Code Interpreting for AI apps',
- },
- description: 'Open-source secure sandboxes for AI code execution',
- twitter: {
- title: 'E2B - Code Interpreting for AI apps',
- description: 'Open-source secure sandboxes for AI code execution',
- },
- openGraph: {
- title: 'E2B - Code Interpreting for AI apps',
- description: 'Open-source secure sandboxes for AI code execution',
- },
-}
-
-export default function RootLayout({
- children,
-}: {
- children: React.ReactNode
-}) {
- return (
- <html lang="en">
- <body>
- {children}
- </body>
- </html>
- )
-}
diff --git a/apps/docs/src/app/(dashboard)/api/status/pro/route.ts b/apps/docs/src/app/(dashboard)/api/status/pro/route.ts
deleted file mode 100644
index 9df5d770b..000000000
--- a/apps/docs/src/app/(dashboard)/api/status/pro/route.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-process.env.E2B_DOMAIN = process.env.E2B_STATUS_DOMAIN
-import { Sandbox } from 'e2b'
-
-export const dynamic = 'force-dynamic' // static by default, unless reading the request
-export const runtime = 'nodejs'
-
-export async function GET() {
- try {
- console.log('Creating sandbox...')
- const sandbox = await Sandbox.create({
- onStdout: (data) => {
- console.log('sandbox stdout:', data)
- },
- onStderr: (data) => {
- console.error('sandbox stderr:', data)
- },
- })
- console.log(`Sandbox '${sandbox.id}' created`)
- await sandbox.close()
- return new Response(`Sandbox '${sandbox.id}' created`, { status: 200 })
- } catch (error) {
- console.error('Error creating sandbox')
- console.error('Status:', error.status)
- console.error(error)
- return new Response(error.statusText || 'Error creating sandbox', { status: error.status || 500 })
- }
-}
diff --git a/apps/docs/src/app/(dashboard)/api/status/route.ts b/apps/docs/src/app/(dashboard)/api/status/route.ts
deleted file mode 100644
index 8a4d616a2..000000000
--- a/apps/docs/src/app/(dashboard)/api/status/route.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-import { Sandbox } from 'e2b'
-
-export const dynamic = 'force-dynamic' // static by default, unless reading the request
-export const runtime = 'nodejs'
-
-export async function GET() {
- try {
- console.log('Creating sandbox...')
- const sandbox = await Sandbox.create({
- onStdout: (data) => {
- console.log('sandbox stdout:', data)
- },
- onStderr: (data) => {
- console.error('sandbox stderr:', data)
- },
- })
- console.log(`Sandbox '${sandbox.id}' created`)
- await sandbox.close()
- return new Response(`Sandbox '${sandbox.id}' created`, { status: 200 })
- } catch (error) {
- console.error('Error creating sandbox')
- console.error('Status:', error.status)
- console.error(error)
- return new Response(error.statusText || 'Error creating sandbox', { status: error.status || 500 })
- }
-}
-
diff --git a/apps/docs/src/app/(dashboard)/api/cli/page.tsx b/apps/docs/src/app/(docs)/docs/api/cli/page.tsx
similarity index 100%
rename from apps/docs/src/app/(dashboard)/api/cli/page.tsx
rename to apps/docs/src/app/(docs)/docs/api/cli/page.tsx
diff --git a/apps/reverse-proxy/vercel.json b/apps/reverse-proxy/vercel.json
index 416aa3e21..11e842341 100644
--- a/apps/reverse-proxy/vercel.json
+++ b/apps/reverse-proxy/vercel.json
@@ -35,18 +35,8 @@
]
},
{
- "source": "/docs/:path*",
- "destination": "https://e2b-docs.vercel.app/docs/:path*",
- "has": [
- {
- "type": "host",
- "value": "e2b.dev"
- }
- ]
- },
- {
- "source": "/dashboard(\\/)?",
- "destination": "https://e2b-docs.vercel.app/dashboard",
+ "source": "/docs/api/cli",
+ "destination": "https://e2b-docs.vercel.app/docs",
"has": [
{
"type": "host",
@@ -55,8 +45,8 @@
]
},
{
- "source": "/dashboard/:path*",
- "destination": "https://e2b-docs.vercel.app/dashboard/:path*",
+ "source": "/docs/:path*",
+ "destination": "https://e2b-docs.vercel.app/docs/:path*",
"has": [
{
"type": "host",
@@ -65,8 +55,8 @@
]
},
{
- "source": "/api(\\/)?",
- "destination": "https://e2b-docs.vercel.app/api",
+ "source": "/dashboard(\\/)?",
+ "destination": "https://e2b-docs.vercel.app/dashboard",
"has": [
{
"type": "host",
@@ -75,8 +65,8 @@
]
},
{
- "source": "/api/:path*",
- "destination": "https://e2b-docs.vercel.app/api/:path*",
+ "source": "/dashboard/:path*",
+ "destination": "https://e2b-docs.vercel.app/dashboard/:path*",
"has": [
{
"type": "host",