Skip to content

Commit 98404e5

Browse files
authored
Merge pull request #126 from nanovms/d
adding in d example
2 parents d411c9b + 12af685 commit 98404e5

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

d/README.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
D Hello World
2+
==================
3+
4+
```sh
5+
export DC=/usr/bin/dmd
6+
dub build
7+
```
8+
9+
```sh
10+
eyberg@s1:~/dz$ ops run dz -p 8080
11+
running local instance
12+
booting /home/eyberg/.ops/images/dz ...
13+
en1: assigned 10.0.2.15
14+
[main(----) INF] Listening for requests on http://[::]:8080/
15+
[main(----) INF] Listening for requests on http://0.0.0.0:8080/
16+
Vibe was run as root, and no user/group has been specified for privilege
17+
lowering. Running with full permissions.
18+
en1: assigned FE80::D0E8:FFFF:FEF9:37EA
19+
```

d/dub.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"authors": [
3+
"eyberg"
4+
],
5+
"copyright": "Copyright © 2023, eyberg",
6+
"description": "A minimal D application.",
7+
"license": "proprietary",
8+
"name": "dz",
9+
"dependencies": {
10+
"vibe-d": "~>0.9.0"
11+
}
12+
}

d/source/app.d

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import std.stdio;
2+
3+
/+ dub.sdl:
4+
dependency "vibe-d" version="~>0.9.0"
5+
+/
6+
void main()
7+
{
8+
import vibe.d;
9+
listenHTTP(":8080", (req, res) {
10+
res.writeBody("Hello, World: " ~ req.path);
11+
});
12+
runApplication();
13+
}

0 commit comments

Comments
 (0)