mirror of https://github.com/usbharu/Hideout.git
commit
a3bf8c78bc
|
@ -35,3 +35,5 @@ out/
|
|||
### VS Code ###
|
||||
.vscode/
|
||||
*.db
|
||||
/src/main/resources/static/
|
||||
/node_modules/
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "hideout",
|
||||
"version": "1.0.0",
|
||||
"dependencies": {
|
||||
"solid-js": "^1.7.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.0.4",
|
||||
"vite": "^4.2.1",
|
||||
"vite-plugin-solid": "^2.7.0",
|
||||
"@suid/vite-plugin": "^0.1.3"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"serve": "vite preview"
|
||||
}
|
||||
}
|
|
@ -90,6 +90,7 @@ fun Application.parent() {
|
|||
|
||||
configureKoin(module)
|
||||
configureHTTP()
|
||||
configureStaticRouting()
|
||||
configureMonitoring()
|
||||
configureSerialization()
|
||||
register(inject<IUserAuthService>().value)
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package dev.usbharu.hideout.plugins
|
||||
|
||||
import io.ktor.http.*
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.http.content.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
|
||||
fun Application.configureStaticRouting() {
|
||||
routing {
|
||||
get("/") {
|
||||
call.respondText(
|
||||
String.javaClass.classLoader.getResourceAsStream("static/index.html").readAllBytes().decodeToString(),
|
||||
contentType = ContentType.Text.Html
|
||||
)
|
||||
}
|
||||
static("/") {
|
||||
resources("static")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
import {Component} from "solid-js";
|
||||
|
||||
export const App:Component = () => {
|
||||
return (<p>aaa</p>)
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<title>Solid App</title>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
|
||||
<script src="/index.tsx" type="module"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,15 @@
|
|||
/* @refresh reload */
|
||||
import {render} from 'solid-js/web';
|
||||
|
||||
// import './index.css';
|
||||
import {App} from './App';
|
||||
|
||||
const root = document.getElementById('root');
|
||||
|
||||
if (import.meta.env.DEV && !(root instanceof HTMLElement)) {
|
||||
throw new Error(
|
||||
'Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got mispelled?',
|
||||
);
|
||||
}
|
||||
|
||||
render(() => <App/>, root!);
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"target": "ESNext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"jsx": "preserve",
|
||||
"jsxImportSource": "solid-js",
|
||||
"types": ["vite/client"],
|
||||
"noEmit": true,
|
||||
"isolatedModules": true
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
import { defineConfig } from 'vite';
|
||||
import solidPlugin from 'vite-plugin-solid';
|
||||
import suidPlugin from "@suid/vite-plugin";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [solidPlugin(),suidPlugin()],
|
||||
server: {
|
||||
port: 3000,
|
||||
proxy: {
|
||||
'/api': 'http://localhost:8080'
|
||||
}
|
||||
},
|
||||
root: './src/main/web',
|
||||
build: {
|
||||
target: 'esnext',
|
||||
outDir: '../resources/static',
|
||||
},
|
||||
});
|
Loading…
Reference in New Issue