mirror of
https://github.com/dalbodeule/chibot-chzzk-bot.git
synced 2025-06-09 07:18:22 +00:00
add Session flows
- fix CORS
This commit is contained in:
parent
a828e23767
commit
e18571778a
@ -20,7 +20,6 @@ import io.ktor.server.sessions.*
|
|||||||
import io.ktor.server.websocket.*
|
import io.ktor.server.websocket.*
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
import space.mori.chzzk_bot.common.dotenv
|
|
||||||
import space.mori.chzzk_bot.webserver.routes.*
|
import space.mori.chzzk_bot.webserver.routes.*
|
||||||
import java.time.Duration
|
import java.time.Duration
|
||||||
|
|
||||||
@ -48,8 +47,12 @@ val server = embeddedServer(Netty, port = 8080, ) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
install(CORS) {
|
install(CORS) {
|
||||||
|
allowMethod(HttpMethod.Options)
|
||||||
|
allowMethod(HttpMethod.Put)
|
||||||
|
allowMethod(HttpMethod.Patch)
|
||||||
|
allowMethod(HttpMethod.Delete)
|
||||||
|
allowMethod(HttpMethod.Get)
|
||||||
anyHost()
|
anyHost()
|
||||||
allowHeader(HttpHeaders.ContentType)
|
|
||||||
}
|
}
|
||||||
install(Sessions) {
|
install(Sessions) {
|
||||||
cookie<UserSession>("user_session", storage = SessionStorageMemory()) {}
|
cookie<UserSession>("user_session", storage = SessionStorageMemory()) {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user