File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ setDelims "${","}$"
2
+ get "/p/:id", ctx => {
3
+ ctx.yap "article", {
4
+ "id": ctx.param("id"),
5
+ }
6
+ }
7
+
8
+ run ":8080"
Original file line number Diff line number Diff line change
1
+ package main
2
+
3
+ import "github.com/goplus/yap"
4
+
5
+ const _ = true
6
+
7
+ type blog struct {
8
+ yap.App
9
+ }
10
+ //line demo/classfile_delimiter/blog_yap.gox:1
11
+ func (this * blog ) MainEntry () {
12
+ //line demo/classfile_delimiter/blog_yap.gox:1:1
13
+ this .SetDelims ("${" , "}$" )
14
+ //line demo/classfile_delimiter/blog_yap.gox:2:1
15
+ this .Get ("/p/:id" , func (ctx * yap.Context ) {
16
+ //line demo/classfile_delimiter/blog_yap.gox:3:1
17
+ ctx .Yap__1 ("article" , map [string ]string {"id" : ctx .Param ("id" )})
18
+ })
19
+ //line demo/classfile_delimiter/blog_yap.gox:8:1
20
+ this .Run (":8080" )
21
+ }
22
+ func main () {
23
+ //line demo/classfile_delimiter/blog_yap.gox:8:1
24
+ yap .Gopt_App_Main (new (blog ))
25
+ }
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 ">
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
6
+ < title > Document</ title >
7
+ </ head >
8
+ < body >
9
+ article: ${ .id }$
10
+ </ body >
11
+ </ html >
You can’t perform that action at this time.
0 commit comments