Skip to content

Commit

Permalink
Merge pull request #19 from stagas/editor
Browse files Browse the repository at this point in the history
feat: editor
  • Loading branch information
stagas authored Oct 15, 2024
2 parents 8873131 + abae4c3 commit c17bfa0
Show file tree
Hide file tree
Showing 96 changed files with 6,506 additions and 303 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
- [x] AssemblyScript
- [x] WebAudio
- [x] Wasm AudioWorklet
- [ ] WebGL
- [x] WebGL
- [x] WebRTC
- [x] QRCode
- [ ] Maps
Expand Down Expand Up @@ -92,7 +92,7 @@
- [x] OAuthRegister
- [x] QrCode
- [x] WebSockets
- [ ] UI Showcase
- [x] UI Showcase
- [x] Components
- [x] Header
- [x] Toast
Expand All @@ -104,6 +104,7 @@
- [x] ResetPassword
- [x] VerifyEmail
- [x] UI
- [x] Button
- [x] Fieldset
- [x] Input
- [x] Label
Expand Down
14 changes: 9 additions & 5 deletions admin/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="/favicon.ico" sizes="48x48">
<link rel="icon" href="/favicon.svg" sizes="any" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/favicon.ico" sizes="48x48" />
<link rel="icon" href="/favicon.svg" sizes="any" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" />
<link rel="stylesheet" href="/style.css" />
<title>Vasi - Admin</title>
</head>
<body>
<script type="module">
// KEEP: required for AssemblyScript interop.
globalThis.unmanaged = () => {};
</script>
<div id="container"></div>
<script src="./client.tsx" type="module"></script>
<script src="../lib/watcher.ts" type="module"></script>
Expand Down
6 changes: 6 additions & 0 deletions api/core/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { kv } from "~/api/core/app.ts"
import type { Handler } from '~/api/core/router.ts'
import { sessions } from "~/api/core/sessions.ts"
import { env } from '~/api/env.ts'
import { IS_DEV } from '~/api/core/constants.ts'

const DEBUG = false
const ORIGIN_REGEX = /(https:\/\/[^\/\n]+\.deno\.dev)/g
Expand All @@ -17,6 +18,11 @@ export const cors: Handler = ctx => {
ctx.request.headers.get('referer')

if (!ctx.request.headers.get('upgrade') && origin) {
if (IS_DEV) {
res.headers.set('access-control-allow-origin', origin)
return
}

const [match] = origin.match(ORIGIN_REGEX) ?? []
if (match) {
res.headers.set('access-control-allow-origin', match)
Expand Down
Loading

0 comments on commit c17bfa0

Please sign in to comment.