mirror of
https://github.com/usbharu/Hideout.git
synced 2026-09-26 23:11:10 +00:00
feat: Webクライアントを追加
This commit is contained in:
@@ -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!);
|
||||
Reference in New Issue
Block a user