Almost MVP

This commit is contained in:
2022-11-22 04:03:32 +01:00
parent ea3b7aeecf
commit dcaa052f30
19 changed files with 430 additions and 134 deletions
+6 -5
View File
@@ -6,8 +6,8 @@ import morgan from 'morgan'
import { createServer as createViteServer } from 'vite'
import { createApiRouter } from './server/routes.js'
import { RenderFunction } from './shared/ssr.js'
import { createApiRouter } from './server/routes'
import { RenderFunction } from './shared/ssr'
const HTML_ROUTES = ['/', '/login', '/problem/:id', '/admin', '/profile']
@@ -71,7 +71,7 @@ async function createDevRouter() {
.replace('<!-- INJECT META TAGS -->', metaTagsHtml)
.replace('<!-- SSR OUTLET -->', html)
)
} catch (error) {
} catch (error: any) {
vite.ssrFixStacktrace(error)
next(error)
}
@@ -82,8 +82,9 @@ async function createDevRouter() {
async function createProductionRouter() {
// Load bundled entry point for server side rendering
const render: RenderFunction = ((await import('./dist/entry-server/entry-server.js')) as any)
.default
// @ts-ignore
const render: RenderFunction = (await import('./dist/entry-server/entry-server.js')).default
const r = express.Router()