Releases: zigzap/zap
Release v0.1.0-pre
ZAP Release v0.1.0-pre
Updates
This marks the 0.1.0-pre release of ZAP!
- From now on, I'll use simple vX.Y.Z-pre for pre-releases of ZAP.
- The GitHub releases are auto-generated by a GitHub action
- The first version of the Discord announceybot informs the
#announcement channel about new releases - The README gets auto-updated with the correct
build.zig.zon
instructions.
New Feature: Error Trace Responses!
You can now call r.sendError(err, status_code)
when you catch an error
and a stack trace is returned to the client / browser. This is a
first-cut implementation of the feature. It does not yet honor accept
headers, for example, and just returns plain text.
The README points to a small example.
Random stuff:
At some stage I'll just rewrite announceybot in Zig, and have it cover
all tasks that are now spread in various python scripts. It's just less
hassle when you know the static executable is built, only a few kB in
size so it can actually checked into the git repository if it needs to,
and no GitHub / python package configuration can make it "un-work" 😊.
It's self-contained.
In accordance to above thoughts, I added a ReleaseSmall static version
of the pkghash
tool into the repo, so the GH actions can use it w/o
needing to build it first. It's 55kB in size so I think that's OK.
Using it
To use in your own projects, put this dependency into your build.zig.zon
:
// zap v0.1.0-pre
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.0-pre.tar.gz",
.hash = "122017942fe459da06812370f7fe2bbd304995bb6450c89ae5bdbbe690c3b8908bbd",
}
Here is a complete build.zig.zon
example:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap v0.1.0-pre
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/v0.1.0-pre.tar.gz",
.hash = "122017942fe459da06812370f7fe2bbd304995bb6450c89ae5bdbbe690c3b8908bbd",
}
}
}
Then, in your build.zig
's build
function, add the following before
exe.install()
:
const zap = b.dependency("zap", .{
.target = target,
.optimize = optimize,
});
exe.addModule("zap", zap.module("zap"));
exe.linkLibrary(zap.artifact("facil.io"));
release-0.0.24
ZAP Release release-0.0.24
Updates
Using it
To use in your own projects, put this dependency into your build.zig.zon
:
// zap release-0.0.24
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.24.tar.gz",
.hash = "1220f520fcdd4b3adbca918deeb42f512f7ef4a827680eea8af9abc64b90ed7a5e78",
}
Here is a complete build.zig.zon
example:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap release-0.0.24
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.24.tar.gz",
.hash = "1220f520fcdd4b3adbca918deeb42f512f7ef4a827680eea8af9abc64b90ed7a5e78",
}
}
}
Then, in your build.zig
's build
function, add the following before
exe.install()
:
const zap = b.dependency("zap", .{
.target = target,
.optimize = optimize,
});
exe.addModule("zap", zap.module("zap"));
exe.linkLibrary(zap.artifact("facil.io"));
release-0.0.23
ZAP Release release-0.0.23
Updates
- zap.Middleware.EndpointHander : use endpoints in your middleware chain
- zap.SimpleRequest.get/setContext() : used internally, but you can, too set a per-request context now
See the README for more details and examples.
Using it
To use in your own projects, put this dependency into your build.zig.zon
:
// zap release-0.0.23
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.23.tar.gz",
.hash = "1220175a7495f41889208349fedd6a35e96d8e413e5cd23b9b875e40d176bad459e1",
}
Here is a complete build.zig.zon
example:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap release-0.0.23
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.23.tar.gz",
.hash = "1220175a7495f41889208349fedd6a35e96d8e413e5cd23b9b875e40d176bad459e1",
}
}
}
Then, in your build.zig
's build
function, add the following before
exe.install()
:
const zap = b.dependency("zap", .{
.target = target,
.optimize = optimize,
});
exe.addModule("zap", zap.module("zap"));
exe.linkLibrary(zap.artifact("facil.io"));
release-0.0.22
ZAP Release release-0.0.22
Updates
- synced to std.json updates. Thx to @edyu for the PR!
- no more
-localhost
workaround releases 🥳 since the TLS bug is fixed in zig master!
Using it
To use in your own projects, put this dependency into your build.zig.zon
:
// zap release-0.0.22
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.22.tar.gz",
.hash = "12204761c4f94997c3bd26f420cf9060541c0c09514370dc129e04b35e58d9f3ae71",
}
Here is a complete build.zig.zon
example:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap release-0.0.22
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.22.tar.gz",
.hash = "12204761c4f94997c3bd26f420cf9060541c0c09514370dc129e04b35e58d9f3ae71",
}
}
}
Then, in your build.zig
's build
function, add the following before
exe.install()
:
const zap = b.dependency("zap", .{
.target = target,
.optimize = optimize,
});
exe.addModule("zap", zap.module("zap"));
exe.linkLibrary(zap.artifact("facil.io"));
release-0.0.21-localhost
ZAP Release release-0.0.21-localhost
This is probably the last localhost release, as 14 hours ago Andrew fixed the bug causing the need for it. Unfortunately, it didn't make it into the last nightly build.
Using it
To use in your own projects, put this dependency into your build.zig.zon
:
// zap release-0.0.21-localhost
.zap = .{
.url = "http://127.0.0.1:8000/release-0.0.21-localhost.tar.gz",
.hash = "12207c67914fc9f69de6d614df75364e85bc2ebd847a659e8a904981bc7bb125c3cd",
}
$ # get dependency required by zap
$ wget https://github.com/zigzap/facil.io/archive/refs/tags/zap-0.0.8.tar.gz
$ # get zap itself
$ wget https://github.com/zigzap/zap/archive/refs/tags/release-0.0.21-localhost.tar.gz
$ # start a http server on port 8000
$ python -m http.server
This hosts the downloaded dependencies locally on port 8000. After the firstzig build
, you can stop the python http server with CTRL+C.
From then on, this release of ZAP and its dependency will remain in ZIG's global build cache. So you don't need to start an HTTP server on every build.
Here is a complete build.zig.zon
example:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap release-0.0.21-localhost
.zap = .{
.url = "http://127.0.0.1:8000/release-0.0.21-localhost.tar.gz",
.hash = "12207c67914fc9f69de6d614df75364e85bc2ebd847a659e8a904981bc7bb125c3cd",
}
}
}
Then, in your build.zig
's build
function, add the following before
exe.install()
:
const zap = b.dependency("zap", .{
.target = target,
.optimize = optimize,
});
exe.addModule("zap", zap.module("zap"));
exe.linkLibrary(zap.artifact("facil.io"));
release-0.0.21
ZAP Release release-0.0.21
Updates
Middleware support! Check out the readme for more info and pointers.
Using it
To use in your own projects, put this dependency into your build.zig.zon
:
// zap release-0.0.21
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.21.tar.gz",
.hash = "12202384c46e9e2059fb5082c61c42aae2421edff233cb8cecef682114cbbabf7197",
}
Here is a complete build.zig.zon
example:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap release-0.0.21
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.21.tar.gz",
.hash = "12202384c46e9e2059fb5082c61c42aae2421edff233cb8cecef682114cbbabf7197",
}
}
}
Then, in your build.zig
's build
function, add the following before
exe.install()
:
const zap = b.dependency("zap", .{
.target = target,
.optimize = optimize,
});
exe.addModule("zap", zap.module("zap"));
exe.linkLibrary(zap.artifact("facil.io"));
release-0.0.20-localhost
Just a quick one: SimpleHttpListener's ListenerSettings define an on_request
. If provided, this function will be called if no endpoint was found for an incoming request. The endpoints example has been updated accordingly.
// zap release-0.0.20-localhost
.zap = .{
.url = "http://127.0.0.1/release-0.0.20-localhost.tar.gz",
.hash = "12204c663be7639e98af40ad738780014b18bcf35efbdb4c701aad51c7dec45abf4d",
}
$ # get dependency required by zap
$ wget https://github.com/zigzap/facil.io/archive/refs/tags/zap-0.0.8.tar.gz
$ # get zap itself
$ wget https://github.com/zigzap/zap/archive/refs/tags/release-0.0.20-localhost.tar.gz
$ # start a http server on port 8000
$ python -m http.server
This hosts the downloaded dependencies locally on port 8000. After the firstzig build
, you can stop the python http server with CTRL+C.
From then on, this release of ZAP and its dependency will remain in ZIG's global build cache. So you don't need to start an HTTP server on every build.
release-0.0.20
ZAP Release release-0.0.20
Updates
SimpleEndpointListener now uses the on_request
callback if no endpoint matches the requested URL. See the updated endpoint example.
Using it
To use in your own projects, put this dependency into your build.zig.zon
:
// zap release-0.0.20
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.20.tar.gz",
.hash = "12200772b594bc50bbdc18b14aa3c7461991a33179f9c254de05eb34d214662971da",
}
Here is a complete build.zig.zon
example:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap release-0.0.20
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.20.tar.gz",
.hash = "12200772b594bc50bbdc18b14aa3c7461991a33179f9c254de05eb34d214662971da",
}
}
}
Then, in your build.zig
's build
function, add the following before
exe.install()
:
const zap = b.dependency("zap", .{
.target = target,
.optimize = optimize,
});
exe.addModule("zap", zap.module("zap"));
exe.linkLibrary(zap.artifact("facil.io"));
release-0.0.19-localhost
ZAP Release release-0.0.19-localhost
Latest zig-master has problems handling the recent GitHub redirects to codeload.github.com
. My work-around for this is as follows:
Change your build.zig.zon
zap dependency to localhost:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap release-0.0.19-localhost
.zap = .{
.url = "http://127.0.0.1:8000/release-0.0.19-localhost.tar.gz",
.hash = "12201fe4eca3c4b43245d4268c22e5056b5d1b273e44cc9724f807a43c16b9b7b36f",
}
}
}
$ # get dependency required by zap
$ wget https://github.com/zigzap/facil.io/archive/refs/tags/zap-0.0.8.tar.gz
$ # get zap itself
$ wget https://github.com/zigzap/zap/archive/refs/tags/release-0.0.19-localhost.tar.gz
$ # start a http server on port 8000
$ python -m http.server
This hosts the downloaded dependencies locally on port 8000. After the firstzig build
, you can stop the python http server with CTRL+C.
Generic
To use in your own projects, put this dependency into your build.zig.zon
:
// zap release-0.0.11-localhost
.zap = .{
.url = "http://127.0.0.1:8000/release-0.0.19-localhost.tar.gz",
.hash = "12201fe4eca3c4b43245d4268c22e5056b5d1b273e44cc9724f807a43c16b9b7b36f",
}
Here is a complete build.zig.zon
example:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap release-0.0.11-localhost
.zap = .{
.url = "http://127.0.0.1:8000/release-0.0.19-localhost.tar.gz",
.hash = "12201fe4eca3c4b43245d4268c22e5056b5d1b273e44cc9724f807a43c16b9b7b36f",
}
}
}
Then, in your build.zig
's build
function, add the following before
exe.install()
:
const zap = b.dependency("zap", .{
.target = target,
.optimize = optimize,
});
exe.addModule("zap", zap.module("zap"));
exe.linkLibrary(zap.artifact("facil.io"));
release-0.0.19
ZAP Release release-0.0.19
Updates
SimpleRequest.sendFile()
- see the example mentioned in the README.
Using it
To use in your own projects, put this dependency into your build.zig.zon
:
// zap release-0.0.19
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.19.tar.gz",
.hash = "1220e8618ae2240e22e1e01c3f5f8c95f70291cd5ca98c92bdfb86b01e81a9d0314b",
}
Here is a complete build.zig.zon
example:
.{
.name = "My example project",
.version = "0.0.1",
.dependencies = .{
// zap release-0.0.19
.zap = .{
.url = "https://github.com/zigzap/zap/archive/refs/tags/release-0.0.19.tar.gz",
.hash = "1220e8618ae2240e22e1e01c3f5f8c95f70291cd5ca98c92bdfb86b01e81a9d0314b",
}
}
}
Then, in your build.zig
's build
function, add the following before
exe.install()
:
const zap = b.dependency("zap", .{
.target = target,
.optimize = optimize,
});
exe.addModule("zap", zap.module("zap"));
exe.linkLibrary(zap.artifact("facil.io"));