-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
186 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
{ | ||
"name": "server", | ||
"dependencies": { | ||
"archttp": "~>1.1.1" | ||
"archttp": "~>1.1.1", | ||
"mir-cpuid": "~>1.2.10" | ||
}, | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import archttp; | ||
|
||
void main() | ||
{ | ||
auto app = new Archttp; | ||
|
||
app.get("/", (req, res) { | ||
res.send(""); | ||
}); | ||
|
||
app.get("/user/{id}", (req, res) { | ||
res.send(req.params["id"]); | ||
}); | ||
|
||
app.post("/user", (req, res) { | ||
res.send(""); | ||
}); | ||
|
||
app.listen(3000); | ||
} | ||
import archttp; | ||
import cpuid.unified; | ||
|
||
void main(string[] args) | ||
{ | ||
Archttp app = new Archttp(threads); | ||
|
||
app.get("/", (HttpRequest req, HttpResponse res) { | ||
res.send(""); | ||
}); | ||
|
||
app.get("/user/{id}", (HttpRequest req, HttpResponse res) { | ||
res.send(req.params["id"]); | ||
}); | ||
|
||
app.post("/user", (HttpRequest req, HttpResponse res) { | ||
res.send(""); | ||
}); | ||
|
||
app.listen(3000); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dub/ | ||
server | ||
dub.selections.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
framework: | ||
github: adamdruppe/arsd | ||
version: 10.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "server", | ||
"dependencies": { | ||
"arsd-official:cgi": "~>10.9.10" | ||
}, | ||
"subConfigurations": {"arsd-official:cgi": "embedded_httpd_hybrid"}, | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import arsd.cgi; | ||
import std.algorithm: startsWith; | ||
|
||
void handler(Cgi cgi) { | ||
cgi.setResponseContentType("text/plain"); | ||
|
||
if (startsWith(cgi.pathInfo, "/user")) { | ||
if (cgi.requestMethod == Cgi.RequestMethod.POST) | ||
cgi.write("", true); | ||
else | ||
cgi.write(cgi.pathInfo[6..$], true); | ||
} | ||
else | ||
cgi.write("", true); | ||
} | ||
|
||
void main() { | ||
auto server = RequestServer(3000); | ||
server.serve!handler; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
framework: | ||
github: andrewlalis/handy-httpd | ||
version: 7.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "server", | ||
"dependencies": { | ||
"handy-httpd": "~>7.1.0" | ||
}, | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import handy_httpd; | ||
import std.algorithm: startsWith; | ||
|
||
void main() { | ||
ServerConfig cfg = ServerConfig.defaultValues(); | ||
cfg.workerPoolSize = 5; | ||
cfg.hostname = "0.0.0.0"; | ||
cfg.port = 3000; | ||
new HttpServer((ref ctx) { | ||
if (ctx.request.url == "/") { | ||
ctx.response.setStatus(HttpStatus.OK); | ||
ctx.response.writeBodyString(""); | ||
} else if (ctx.request.url == "/user" && ctx.request.method == Method.POST) { | ||
ctx.response.setStatus(HttpStatus.OK); | ||
ctx.response.writeBodyString(""); | ||
} else if (startsWith(ctx.request.url, "/user/") && ctx.request.method == Method.GET) { | ||
ctx.response.setStatus(HttpStatus.OK); | ||
ctx.response.writeBodyString(ctx.request.url[6..$]); | ||
} | ||
}, cfg).start(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
framework: | ||
github: Kripth/lighttp | ||
version: 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "server", | ||
"dependencies": { | ||
"lighttp": "~>0.5.4" | ||
}, | ||
"license": "MIT" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"fileVersion": 1, | ||
"versions": { | ||
"libasync": "~master", | ||
"lighttp": "0.5.4", | ||
"memutils": "1.0.9", | ||
"urld": "2.1.1", | ||
"xbuffer": "1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import lighttp; | ||
|
||
void main(string[] args) { | ||
Server server = new Server(); | ||
server.host("0.0.0.0", 3000); | ||
server.router.add(new Router()); | ||
server.run(); | ||
} | ||
|
||
final class Router | ||
{ | ||
// GET / | ||
@Get("") get(ServerResponse response) { | ||
response.headers["Content-Type"] = "text/plain"; | ||
response.body = ""; | ||
} | ||
|
||
// GET /user/100 => id = "100" | ||
@Get("user", "([0-9]+)") getUser(ServerResponse response, string userId) { | ||
response.headers["Content-Type"] = "text/plain"; | ||
response.body = userId; | ||
} | ||
|
||
// POST /user | ||
@Post("user") post(ServerResponse response) { | ||
response.headers["Content-Type"] = "text/plain"; | ||
response.body = ""; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { Router } from '@stricjs/router'; | ||
|
||
export default new Router() | ||
.get('/', () => new Response("")) | ||
.get('/user/:id', ({ params: { id } }) => new Response(id)) | ||
.post('/user', () => new Response("")); | ||
.get('/', () => new Response()) | ||
.get('/user/:id', req => new Response(req.params.id)) | ||
.post('/user', () => new Response()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"dependencies": { | ||
"@stricjs/router": "~3.2.7" | ||
"@stricjs/router": "3.2.7", | ||
"@stricjs/utils": "1.3.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM nimlang/nim:1.6.12-alpine | ||
FROM nimlang/nim:1.6.14-alpine | ||
|
||
RUN apk update && \ | ||
apk upgrade --no-cache | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
framework: | ||
github: HapticX/happyx | ||
version: 1.7 | ||
version: '1.10' | ||
|
||
build_opts: "-d:beast --threads:on" | ||
build_with: nimble install -d -y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
import happyx | ||
|
||
|
||
serve("0.0.0.0", 3000): | ||
serve "0.0.0.0", 3000: | ||
get "/": | ||
"" | ||
|
||
get "/user/$id": | ||
id | ||
|
||
post "/user": | ||
"" | ||
|
||
notfound: | ||
"method not allowed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
framework: | ||
website: slimframework.com | ||
version: 4.9 | ||
version: 4.12 | ||
|
||
engines: | ||
- road-runner | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
framework: | ||
website: slimframework.com | ||
version: 4.9 | ||
version: 4.12 | ||
|
||
engines: | ||
- swoole | ||
|
Oops, something went wrong.