Skip to content

feat: Configure Cloudflare Workers environment #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ yarn-error.log*

# env files (can opt-in for committing if needed)
.env*
.dev.vars

# vercel
.vercel

# wrangler
.wrangler/

# typescript
*.tsbuildinfo
next-env.d.ts
13 changes: 13 additions & 0 deletions app/api/health/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { NextResponse } from "next/server";

// Configure for Edge Runtime
export const runtime = "edge";

export async function GET() {
return NextResponse.json({
status: "ok",
timestamp: new Date().toISOString(),
runtime: "edge",
env: process.env.NODE_ENV,
});
}
16 changes: 8 additions & 8 deletions docs/TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ This document tracks the implementation progress of GhostPaste. Check off tasks

### Initial Setup
- [x] Initialize Next.js 15 project with TypeScript (using `create-next-app`) - [#5](https://github.com/nullcoder/ghostpaste/issues/5)
- [ ] Set up Cloudflare Workers environment with wrangler - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [ ] Configure project for Next.js on Cloudflare Workers using @cloudflare/next-on-pages - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [ ] Configure Edge Runtime compatibility for all routes - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [x] Set up Cloudflare Workers environment with wrangler - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [x] Configure project for Next.js on Cloudflare Workers using @cloudflare/next-on-pages - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [x] Configure Edge Runtime compatibility for all routes - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [ ] Configure ESLint and Prettier - [#7](https://github.com/nullcoder/ghostpaste/issues/7)
- [ ] Set up Git hooks with Husky and lint-staged - [#7](https://github.com/nullcoder/ghostpaste/issues/7)
- [ ] Create wrangler.toml with R2 bucket bindings and environment variables - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [x] Create wrangler.toml with R2 bucket bindings and environment variables - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [ ] Configure path aliases in `tsconfig.json` - [#7](https://github.com/nullcoder/ghostpaste/issues/7)
- [ ] Set up VS Code workspace settings - [#7](https://github.com/nullcoder/ghostpaste/issues/7)
- [ ] Create .dev.vars for local development secrets - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [x] Create .dev.vars for local development secrets - [#6](https://github.com/nullcoder/ghostpaste/issues/6)

### Dependencies
- [ ] Install @cloudflare/next-on-pages for Workers deployment - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [ ] Install wrangler for local development - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [x] Install @cloudflare/next-on-pages for Workers deployment - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [x] Install wrangler for local development - [#6](https://github.com/nullcoder/ghostpaste/issues/6)
- [ ] Install and configure shadcn/ui (using official CLI) - [#8](https://github.com/nullcoder/ghostpaste/issues/8)
- [ ] Install CodeMirror 6 and language modes - [#9](https://github.com/nullcoder/ghostpaste/issues/9)
- [ ] Install nanoid for ID generation - [#9](https://github.com/nullcoder/ghostpaste/issues/9)
- [ ] Install @cloudflare/workers-types for type definitions - [#9](https://github.com/nullcoder/ghostpaste/issues/9)
- [x] Install @cloudflare/workers-types for type definitions - [#9](https://github.com/nullcoder/ghostpaste/issues/9)
- [ ] Install development dependencies (vitest, @testing-library/react) - [#10](https://github.com/nullcoder/ghostpaste/issues/10)
- [ ] Install next-themes for theme management - [#8](https://github.com/nullcoder/ghostpaste/issues/8)

Expand Down
5 changes: 4 additions & 1 deletion next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import type { NextConfig } from "next";

const nextConfig: NextConfig = {
/* config options here */
// Disable image optimization (not supported on Edge Runtime)
images: {
unoptimized: true,
},
};

export default nextConfig;
Loading