sad, confuses a lot of customers thinking it does, and then building... and then ohh that was an old
sad, confuses a lot of customers thinking it does, and then building... and then ohh that was an old outdated post...
import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello Cloudflare Workers!'))
export default appwrangler pages secret put


npm run start after successfully running npm run build.

/functions/[[path]].ts file wrangler pages deployment tail is probably what you're looking for
functions folder always got ignored. I tried putting it at same level as package.json, under src, under src/app, nothing worked. The build output (.vercel/output/) doesn’t contain my function. When I run the website locally and try to call my API localhost:8788/api/helloworld, I only see 404 Error. Do I need to declare anything in wrangler.toml or change my build command (currently it is like in the first guide) for my functions folder to work? Thanks in advance!

functions directory api routing.opennext-cloudflare for cloudflare workers assets and next-on-pages for cloudflare pages


No routes detected when building functions directory as these helper functions do not follow the functions format, you should just create a src folder in the output directory and have all your helper functions there, you can access them from your pages functions as follows:import { sendEmail } from "/src/utils/email.js";

"/src/theRestOfThePathToYourFile";



export function log() { console.log('So How Is Your Day?'); and it works so far.import { log } from "./sendLog.js";import { Hono } from 'hono'
const app = new Hono()
app.get('/', (c) => c.text('Hello Cloudflare Workers!'))
export default appwrangler pages secret putnpm run start/functions/[[path]].tsimport { createRequestHandler } from "@remix-run/cloudflare-pages";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - the server build file is generated by `remix vite:build`
// eslint-disable-next-line import/no-unresolved
import * as build from "../build/server";
export const onRequest = createRequestHandler({
//@ts-ignore
build,
});functionsfunctionsfunctionssrc/app.vercel/output/localhost:8788/api/helloworldopennext-cloudflare ✘ [ERROR] No routes found when building Functions directory: /opt/buildhome/repo/functionsRoot directory:
= dist
= functions
| - index.js
| - auth
| - login.js
| - register.js
| - resetpassword.js
= src
= _routes.json
= wrangler.tomlNo routes detected when building functions directoryimport { sendEmail } from "/src/utils/email.js";"/src/theRestOfThePathToYourFile";export function log() { console.log('So How Is Your Day?');import { log } from "./sendLog.js";