diff --git a/.gitignore b/.gitignore index 23cb6fa..9f6d7b4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ zig-out/ -.zig-cache/ +zig-cache/ *.core static/ .jetzig -src/app/database/data.db-journal +src/app/database/data.db-journal \ No newline at end of file diff --git a/src/app/views/music.zig b/src/app/views/music.zig deleted file mode 100644 index 4dd0d07..0000000 --- a/src/app/views/music.zig +++ /dev/null @@ -1,41 +0,0 @@ -const std = @import("std"); -const jetzig = @import("jetzig"); - -pub const static_params = .{ - .index = .{ - //.{ .params = .{ .foo = "hi", .bar = "bye" } }, - //.{ .params = .{ .foo = "hello", .bar = "goodbye" } }, - }, - //.get = .{ - // .{ .id = "1", .params = .{ .foo = "hi", .bar = "bye" } }, - // .{ .id = "2", .params = .{ .foo = "hello", .bar = "goodbye" } }, - //}, -}; - -pub fn index(request: *jetzig.StaticRequest, data: *jetzig.Data) !jetzig.View { - var root = try data.object(); - - const params = try request.params(); - - if (params.get("foo")) |foo| try root.put("foo", foo); - if (params.get("foo") == null) try root.put("foo", data.string("no foo")); - if (params.get("bar")) |bar| try root.put("bar", bar); - if (params.get("bar") == null) try root.put("bar", data.string("no bar")); - - return request.render(.ok); -} - -//pub fn get(id: []const u8, request: *jetzig.StaticRequest, data: *jetzig.Data) !jetzig.View { -// var root = try data.object(); -// -// const params = try request.params(); -// -// if (std.mem.eql(u8, id, "1")) { -// try root.put("id", data.string("id is '1'")); -// } -// -// if (params.get("foo")) |foo| try root.put("foo", foo); -// if (params.get("bar")) |bar| try root.put("bar", bar); -// -// return request.render(.created); -//} \ No newline at end of file diff --git a/src/app/views/music/index.zmpl b/src/app/views/music/index.zmpl deleted file mode 100644 index a14b357..0000000 --- a/src/app/views/music/index.zmpl +++ /dev/null @@ -1,2 +0,0 @@ -
{{.foo}}
-
{{.bar}}
\ No newline at end of file