feat(stats): route stats app
This commit is contained in:
@@ -16,6 +16,7 @@ function AppMeta() {
|
||||
export default function App() {
|
||||
return (
|
||||
<Router
|
||||
base={import.meta.env.BASE_URL.replace(/\/$/, "")}
|
||||
explicitLinks={true}
|
||||
root={(props) => (
|
||||
<MetaProvider>
|
||||
|
||||
@@ -1213,7 +1213,7 @@ function Header() {
|
||||
return (
|
||||
<header data-component="top" data-menu-open={menuOpen() ? "true" : undefined}>
|
||||
<div data-slot="header-bar">
|
||||
<a data-slot="brand" href="/" aria-label="OpenCode home">
|
||||
<a data-slot="brand" href={import.meta.env.BASE_URL} aria-label="Stats home">
|
||||
<StatsWordmark />
|
||||
</a>
|
||||
<nav data-component="section-nav" aria-label="Stats sections">
|
||||
@@ -1436,7 +1436,7 @@ function SubscribeModal(props: { onClose: () => void }) {
|
||||
event.preventDefault()
|
||||
setStatus("pending")
|
||||
setMessage("")
|
||||
fetch("/api/newsletter", {
|
||||
fetch(`${import.meta.env.BASE_URL}api/newsletter`, {
|
||||
method: "POST",
|
||||
body: new FormData(event.currentTarget),
|
||||
}).then(
|
||||
|
||||
1
packages/stats/app/src/routes/stats/api/health.ts
Normal file
1
packages/stats/app/src/routes/stats/api/health.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { GET } from "../../api/health"
|
||||
1
packages/stats/app/src/routes/stats/api/newsletter.ts
Normal file
1
packages/stats/app/src/routes/stats/api/newsletter.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { POST } from "../../api/newsletter"
|
||||
@@ -3,6 +3,7 @@ import { nitro } from "nitro/vite"
|
||||
import { defineConfig, type PluginOption } from "vite"
|
||||
|
||||
export default defineConfig({
|
||||
base: "/stats/",
|
||||
plugins: [
|
||||
solidStart() as PluginOption,
|
||||
nitro({
|
||||
|
||||
Reference in New Issue
Block a user