1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 15:14:08 +00:00
Commit graph

266 commits

Author SHA1 Message Date
renerocksai
8540828bf5
0.15.1-fix websockets example 2025-08-28 22:31:12 +02:00
renerocksai
a45baf78ea
0.15.1-fix cookies example 2025-08-28 22:27:51 +02:00
renerocksai
7672a5e099
0.15.1-fix http_params example 2025-08-28 22:22:59 +02:00
renerocksai
23162dbe2e
fix hello_json 2025-08-28 20:29:11 +02:00
renerocksai
5740b3b1a1
fix app_basic 0.15.1 2025-08-28 20:24:35 +02:00
renerocksai
f4d1ac0a30
fix #178 status code mismatch 2025-08-28 20:21:23 +02:00
Tesseract22
3c22e9dac5
chore: update to latest zig version
zig 0.15 introduced tons of breaking changes in the standard library,
fix them.
2025-08-28 17:47:44 +02:00
Michael Pollind
512c630781 feat: tweak support for additional cookie fields
Signed-off-by: Michael Pollind <mpollind@gmail.com>
2025-08-10 18:59:27 -07:00
Michael Pollind
6174c3e5e0 feat: add parition support for cookies in facil.io
Signed-off-by: Michael Pollind <mpollind@gmail.com>
2025-08-06 21:12:08 -07:00
renerocksai
d9739599ec
added fio-typecheck of mimetype field when parsing binfiles 2025-07-25 01:59:02 +02:00
renerocksai
dabd0637f9
endpoints, auth endpoints, middleware endpoints: eliminate need for empty stubs 2025-07-23 20:23:49 +02:00
renerocksai
baaa71d0e0
tests: fix non-overlapping ports during tests 2025-07-23 20:08:17 +02:00
renerocksai
ef523d7767
zap.App.Endpoint.Authenticating: don't require unauthorized handler, return 405 method not allowed for unimplemented HTTP methods 2025-07-23 01:46:39 +02:00
Rene Schallner
29d339892e
Merge pull request #171 from Tesseract22/master
Provide defaults to unimplemented methods in endpoints for App style api.
2025-07-23 00:51:38 +02:00
Rene Schallner
35634a97cd
Merge pull request #167 from yanis-fourel/master
Accept file with no specified Content-Type
2025-07-23 00:47:08 +02:00
Tesseract22
c0cc025eda Provide defaults to unprovided restful method handler
Make `get`, `post`, ... methods optional. Check whether these method
exist at comptime. When no corresponding method is provided,
the handler simply return immediately.

Since it uses comptime, hopefully it should not add any checks at
runtime.
2025-07-13 15:02:35 +08:00
QSmally
fd567f3c29
Zap: remove newline for Zig's default log fn 2025-05-08 15:30:54 +02:00
Yanis Fourel
283e0d60d0 Add test_recvfile_notype.zig 2025-05-04 20:51:35 +08:00
Yanis Fourel
a7a904aea4 Add test_recvfile.zig 2025-05-04 20:51:35 +08:00
Yanis Fourel
4e1b50aca8 Accept file with no specified Content-Type 2025-05-04 14:31:39 +08:00
Mimi
b134f969f3 fix: add missing head handler for EndpointType 2025-04-21 18:36:46 -03:00
renerocksai
8078b96d3f add on_uncaught_error behavior to zap.App, add on_error callbacks
zap.Endpont.Listener and zap.App now support on_error callbacks:

zap.Endpont.Listener.Settings contains an `on_error` optional callback
field.

zap.App supports those two callbacks:


/// ```zig
/// const MyContext = struct {
///     // You may (optionally) define the following global handlers:
///     pub fn unhandledRequest(_: *MyContext, _: Allocator, _: Request) anyerror!void {}
///     pub fn unhandledError(_: *MyContext, _: Request, _: anyerror) void {}
/// };
/// ```

The `endpoint` example has been updated to showcase `on_error`, and the
new example `app_errors` showcases `Context.unhandledError`.
2025-04-02 09:53:46 +02:00
renerocksai
8d187310c7 harmonize callback function error handling, zap logging; doc updates 2025-04-01 16:30:24 +02:00
renerocksai
a01c6146ec
Minor README & comment cosmetics 2025-03-30 20:32:33 +02:00
renerocksai
3a2246ba50
cleanup unused params where applicable (ie non-instructive) 2025-03-30 19:58:22 +02:00
renerocksai
cc6d55fbf7
Improved & generalized checkEndpoint functions
E.g. return type's error set does not need to be `anyerror` anymore.
2025-03-30 19:37:40 +02:00
renerocksai
43c411dcd7
fix router.zig type checking, remove wrk examples from build.zig 2025-03-30 15:03:35 +02:00
Rene Schallner
75c0cfdf02
Merge branch 'master' into XXX 2025-03-30 14:49:58 +02:00
renerocksai
b8ca82f0fd zap.App.Create(Context).Endpoint.Authenticating -> zap.App is READY. 2025-03-30 13:17:32 +02:00
renerocksai
b05004291e refactored endpoint Binder/Bind/Bound/Interface ... namings 2025-03-30 12:21:08 +02:00
renerocksai
458d6ee071 First zap.App test SUCCESS!!! 2025-03-30 11:28:36 +02:00
renerocksai
51d17a1868 restore lost changes 2025-03-29 11:10:45 +01:00
renerocksai
8654ad8310 Improve code comment in router.zig 2025-03-29 11:10:42 +01:00
Rene Schallner
4d8ba50b17
Merge pull request #125 from cosmicboots/handle_func_introspection
Add type checking to `simple_router`'s `handle_func`
2025-03-29 09:41:56 +01:00
renerocksai
efd26fd3bb app cosmetics 2025-03-27 01:13:33 +01:00
renerocksai
d4a2079542 BoundFunction POLYMORPHIC!!! 2025-03-27 01:13:30 +01:00
renerocksai
6dd3c93a0f BoundFunction YEAH 2025-03-23 23:28:28 +01:00
Rene Schallner
3353b6a525 WIP: progress on Bound function 2025-03-23 23:02:27 +01:00
Rene Schallner
9d3434c21c WIP side-experiment WIP BoundFunction 2025-03-22 20:27:42 +01:00
Rene Schallner
7da0a6fe4e continue working on zap.App 2025-03-22 19:02:30 +01:00
Rene Schallner
029c8ff069 rename types for endpoint wrapping 2025-03-21 20:08:36 +01:00
Rene Schallner
f4e42f2557 add zap.Request.headersToOwnedList() 2025-03-21 19:31:11 +01:00
Rene Schallner
dcd07b7025 remove debug print from test 2025-03-21 19:30:18 +01:00
Rene Schallner
3aaa7fcc24 removed Self and @This() as much as possible 2025-03-21 18:57:33 +01:00
Rene Schallner
9eb254d5f8 get rid of zap.util.FreeOrNot 2025-03-21 18:21:27 +01:00
Rene Schallner
ad2b2f2eb0 added skeleton for App.zig 2025-03-21 11:33:44 +01:00
renerocksai
fcce4517de
introduced error union to request fn return type 2025-03-16 20:16:14 +01:00
renerocksai
7503f090ee
doc update 2025-03-16 16:42:08 +01:00
renerocksai
f77f405320
doc update 2025-03-16 16:33:55 +01:00
renerocksai
ab42f971a0
remove usingnamespace 2025-03-16 16:17:42 +01:00