File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change
1
+ ▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄ ▄▄ ▄▄▄ ▄▄
2
+ ▀▀▀██▀▀▀ ▀▀██▀▀ ▀▀▀██▀▀▀ ████ ███ ██
3
+ ██ ██ ██ ████ ██▀█ ██
4
+ ██ ██ ██ ██ ██ ██ ██ ██
5
+ ██ ██ ██ ██████ ██ █▄██
6
+ ██ ▄▄██▄▄ ██ ▄██ ██▄ ██ ███
7
+ ▀▀ ▀▀▀▀▀▀ ▀▀ ▀▀ ▀▀ ▀▀ ▀▀▀
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import (
4
+ "os"
5
+
6
+ "github.com/pitr/gig"
7
+ )
8
+
9
+ func main () {
10
+ g := gig .Default ()
11
+ g .AllowProxying = true
12
+ g .Use (gig .Titan (1024 ))
13
+
14
+ g .Handle ("/file.txt*" , func (c gig.Context ) error {
15
+ if c .Get ("titan" ).(bool ) {
16
+ data , err := gig .TitanReadFull (c )
17
+ if err != nil {
18
+ return err
19
+ }
20
+
21
+ err = os .WriteFile ("file.txt" , data , 0644 )
22
+ if err != nil {
23
+ return err
24
+ }
25
+ gig .TitanRedirect (c )
26
+ return nil
27
+ }
28
+ return c .File ("file.txt" )
29
+ })
30
+
31
+ g .Run ("../astro.crt" , "../astro.key" )
32
+ }
You can’t perform that action at this time.
0 commit comments