File tree 3 files changed +43
-0
lines changed
3 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,16 @@ RUN v . {{#build_flags}} {{{.}}} {{/build_flags}} -o server
25
25
26
26
FROM debian
27
27
28
+ {{#build_deps.length}}
29
+ ARG DEBIAN_FRONTEND=noninteractive
30
+ RUN apt-get -y update
31
+
32
+ {{#build_deps}}
33
+ RUN apt-get -y install {{{.}}}
34
+ {{/build_deps}}
35
+
36
+ {{/build_deps.length}}
37
+
28
38
WORKDIR /app
29
39
30
40
COPY --from=build /app /app
Original file line number Diff line number Diff line change
1
+ framework :
2
+ github : vlang/v
3
+ version : 0.4
4
+
5
+ build_deps :
6
+ - libatomic1
Original file line number Diff line number Diff line change
1
+ import x.vweb
2
+
3
+ pub struct App {}
4
+
5
+ pub struct Context {
6
+ vweb.Context
7
+ }
8
+
9
+ fn main () {
10
+ mut app := & App{}
11
+ vweb.run[App, Context](mut app, 3000 )
12
+ }
13
+
14
+ @['/' ]
15
+ fn (mut app App) index (mut ctx Context) vweb.Result {
16
+ return ctx.text ('' )
17
+ }
18
+
19
+ @['/user/:id' ]
20
+ fn (mut app App) get_user_id (mut ctx Context, id string ) vweb.Result {
21
+ return ctx.text (id)
22
+ }
23
+
24
+ @['/user' ; post]
25
+ fn (mut app App) post_user (mut ctx Context) vweb.Result {
26
+ return ctx.text ('' )
27
+ }
You can’t perform that action at this time.
0 commit comments