Fresh v2.1.2
Deno v2.5.3
Vite v7.1.10
I was trying to grasp Fresh and its concepts, and documentation, tinkering with the template provided by deno run -Ar jsr:@fresh/init
When I came across issues for both App.fsRoute() and App.mountApp().
According to the documentation for app.fsRoutes, ts modules for the Fresh 2./routes/ the pages returned by the previously mentioned template should be served at http://localhost/my-mount-path if the endpoints do not have any routeOverride (and they do not, they are still served at root).
import { App, cors, staticFiles, trailingSlashes } from "fresh";
import { define, type State } from "./utils.ts";
export const app = new App<State>();
app.use(
staticFiles(),
trailingSlashes("never"),
);
app.fsRoutes("/my-mount-path");
Same behavior arises from App.mountApp documentation:
These two snippets serve the pages served from ./routes/ at root too .
import { App, cors, staticFiles, trailingSlashes } from "fresh";
import { define, type State } from "./utils.ts";
export const app = new App<State>();
app.use(
staticFiles(),
trailingSlashes("never"),
);
const fsApp = new App<State>().fsRoutes("/my-second-mount-path");
app.mountApp("/", fsApp);
import { App, cors, staticFiles, trailingSlashes } from "fresh";
import { define, type State } from "./utils.ts";
export const app = new App<State>();
app.use(
staticFiles(),
trailingSlashes("never"),
);
const fsApp = new App<State>().fsRoutes("/my-second-mount-path");
app.mountApp("/my-mount-path", fsApp);
// Expected behavior: served at http://localhost/my-mount-path/my-second-mount-path
Fresh v2.1.2
Deno v2.5.3
Vite v7.1.10
I was trying to grasp Fresh and its concepts, and documentation, tinkering with the template provided by
deno run -Ar jsr:@fresh/initWhen I came across issues for both
App.fsRoute()andApp.mountApp().According to the documentation for app.fsRoutes, ts modules for the Fresh 2
./routes/the pages returned by the previously mentioned template should be served athttp://localhost/my-mount-pathif the endpoints do not have anyrouteOverride(and they do not, they are still served at root).Same behavior arises from App.mountApp documentation:
These two snippets serve the pages served from
./routes/at root too .