alpha
Login
or
Join now
flo-bit.dev
/
bluesky-website-generator
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/flo-bit/bluesky-website-generator.
bluesky-website-generator.vercel.app
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
cloudflare create & deploy
author
polijn
date
1 year ago
(May 5, 2025, 2:02 AM +0200)
commit
cc2afb94
cc2afb947e1a16875e327dccca93fffda0b748f7
parent
af42a5c1
af42a5c1523013f0721b7cc4fe1ad18a0468fe8e
+36
-6
2 changed files
Expand all
Collapse all
Unified
Split
src
routes
+page.svelte
api
cloudflare
+server.ts
+34
-5
src/routes/+page.svelte
View file
Reviewed
···
1
1
<script lang="ts">
2
2
-
import { Button, Tabs } from '@fuxui/base';
2
2
+
import { Button, Tabs, Input } from '@fuxui/base';
3
3
import { BlueskyLogin, UserProfile } from '@fuxui/social';
4
4
5
5
+
let value = $state('');
6
6
+
5
7
let { data } = $props();
8
8
+
let form = $state<HTMLFormElement | null>(null);
6
9
7
7
-
let form = $state<HTMLFormElement | null>(null);
10
10
+
async function deploy() {
11
11
+
const res = await fetch('/api/cloudflare', {
12
12
+
method: 'POST',
13
13
+
headers: { 'Content-Type': 'application/json' },
14
14
+
body: JSON.stringify({
15
15
+
projectName: data.user.handle.replace(/\./g, '-'),
16
16
+
domain: value + '.polijn.com',
17
17
+
profileHandle: data.user.handle
18
18
+
})
19
19
+
});
20
20
+
21
21
+
// const data = await res.json();
22
22
+
// if (!res.ok) {
23
23
+
// alert('Error: ' + data.error);
24
24
+
// } else {
25
25
+
// alert('Success!);
26
26
+
// }
27
27
+
}
8
28
</script>
9
29
10
30
<div class="mx-auto max-w-2xl">
···
12
32
<BlueskyLogin
13
33
login={async (handle) => {
14
34
// create and submit form with handle
15
15
-
35
35
+
16
36
if (!form) {
17
37
console.error('Form not found');
18
38
return false;
···
31
51
/>
32
52
33
53
<form method="POST" action="/?/login" class="hidden" bind:this={form}>
34
34
-
<input type="hidden" name="handle" value="handle">
54
54
+
<input type="hidden" name="handle" value="handle" />
35
55
</form>
36
56
{:else}
57
57
+
<!-- Publish -->
37
58
<Button size="lg" class="absolute top-2 right-2">Publish</Button>
38
38
-
<UserProfile class="" profile={{ ...data.user, description: '' }} />
59
59
+
<!-- create & deploy -->
60
60
+
<Input
61
61
+
sizeVariant="lg"
62
62
+
class=" top-2 right-2"
63
63
+
placeholder={data.user.handle.split('.')[0]}
64
64
+
bind:value
65
65
+
/>
66
66
+
<Button onclick={deploy} size="lg" class=" top-2 right-2">Create & Deploy</Button>
39
67
68
68
+
<UserProfile class="" profile={{ ...data.user, description: '' }} />
40
69
<Tabs
41
70
active="About"
42
71
items={[
+2
-1
src/routes/api/cloudflare/+server.ts
View file
Reviewed
···
32
32
}
33
33
}
34
34
};
35
35
-
35
35
+
console.log('payload:');
36
36
+
console.log(payload.deployment_configs);
36
37
const res = await fetch(url, {
37
38
method: 'POST',
38
39
headers: {