- spa_server.py: strip /magpie prefix before API check and file lookup; all HTTP methods call _normalise_path() first so /magpie/api/v1/* proxies correctly and /magpie/assets/* resolve against the dist root - manage.sh: pass --base /magpie to spa_server.py so the handler knows the deployment prefix - main.ts: pass import.meta.env.BASE_URL to createWebHistory so Vue Router strips the /magpie prefix before matching routes Without these fixes, assets returned index.html (MIME type error), API calls returned HTML instead of JSON (stats.posts undefined), and router routes never matched (matched: []). Closes: #12
27 lines
1 KiB
TypeScript
27 lines
1 KiB
TypeScript
import { createApp } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import { createRouter, createWebHistory } from 'vue-router'
|
|
import App from './App.vue'
|
|
import './theme.css'
|
|
|
|
import CampaignList from './components/CampaignList.vue'
|
|
import CampaignDetail from './components/CampaignDetail.vue'
|
|
import SubRulesView from './components/SubRulesView.vue'
|
|
import PostsView from './components/PostsView.vue'
|
|
import OpportunitiesView from './components/OpportunitiesView.vue'
|
|
import SignalsView from './components/SignalsView.vue'
|
|
|
|
const router = createRouter({
|
|
history: createWebHistory(import.meta.env.BASE_URL),
|
|
routes: [
|
|
{ path: '/', redirect: '/signals' },
|
|
{ path: '/signals', component: SignalsView },
|
|
{ path: '/opportunities', component: OpportunitiesView },
|
|
{ path: '/campaigns', component: CampaignList },
|
|
{ path: '/campaigns/:id', component: CampaignDetail },
|
|
{ path: '/subs', component: SubRulesView },
|
|
{ path: '/posts', component: PostsView },
|
|
],
|
|
})
|
|
|
|
createApp(App).use(createPinia()).use(router).mount('#app')
|