Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-king-2000 authored Jul 24, 2023
2 parents e65b303 + 1fc0b6a commit c226d03
Show file tree
Hide file tree
Showing 38 changed files with 186 additions and 58 deletions.
2 changes: 1 addition & 1 deletion crystal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
FROM crystallang/crystal:{{{.}}}-alpine
{{/provider.default.image-version}}
{{^provider.default.image-version}}
FROM crystallang/crystal:1.9.1-alpine
FROM crystallang/crystal:1.9.2-alpine
{{/provider.default.image-version}}

WORKDIR /usr/src/app
Expand Down
6 changes: 3 additions & 3 deletions csharp/aspnet-minimal-api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

var app = builder.Build();

app.MapGet("/", () => Task.CompletedTask);
app.MapGet("/", () => { });

app.MapGet("user/{id}", (string id) => id);

app.MapPost("user", () => Task.CompletedTask);
app.MapPost("user", () => { });

app.Run();
app.Run();
1 change: 1 addition & 0 deletions csharp/aspnet-minimal-api/web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<TieredPGO>true</TieredPGO>
</PropertyGroup>

</Project>
1 change: 0 additions & 1 deletion csharp/aspnet-mvc/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
builder.Services.AddControllers();

var app = builder.Build();
app.UseAuthorization();
app.MapControllers();
app.Run();
1 change: 1 addition & 0 deletions csharp/aspnet-mvc/web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<TieredPGO>true</TieredPGO>
</PropertyGroup>

</Project>
18 changes: 14 additions & 4 deletions d/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
FROM dlang2/ldc-ubuntu AS build
FROM debian:bookworm AS build

WORKDIR /usr/src/app

RUN apt-get -qq update
RUN apt-get -qy install build-essential wget openssl ldc dub libssl-dev zlib1g-dev

{{#files}}
COPY '{{source}}' '{{target}}'
{{/files}}

ENV DC=ldc2
RUN dub build -b release --compiler=ldc2 --verbose

FROM ubuntu:bionic
FROM debian:bookworm

WORKDIR /opt/web

RUN apt-get -qq update && apt-get -qy install openssl wget ldc

COPY --from=build /usr/src/app/server /opt/web/server

RUN apt-get -qq update
{{#deps}}
RUN apt-get -qy install {{{.}}}
{{/deps}}

COPY --from=build /usr/src/app/server /usr/src/app/server
{{#static_files}}
COPY '{{source}}' '{{target}}'
{{/static_files}}

{{#environment}}
ENV {{{.}}}
Expand Down
3 changes: 2 additions & 1 deletion d/archttp/dub.json
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"
}
41 changes: 21 additions & 20 deletions d/archttp/source/app.d
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);
}
3 changes: 3 additions & 0 deletions d/cgi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.dub/
server
dub.selections.json
3 changes: 3 additions & 0 deletions d/cgi/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
github: adamdruppe/arsd
version: 10.9
8 changes: 8 additions & 0 deletions d/cgi/dub.json
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"
}
20 changes: 20 additions & 0 deletions d/cgi/source/app.d
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;
}
5 changes: 3 additions & 2 deletions d/config.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
language:
version: 2.096
version: 1.30.0

files:
- "**/*.d"
- dub.json
- dub.selections.json
- dub.sdl

engines:
default:
command: /usr/src/app/server
command: /opt/web/server

framework:
engines:
Expand Down
3 changes: 3 additions & 0 deletions d/handy/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
github: andrewlalis/handy-httpd
version: 7.1
7 changes: 7 additions & 0 deletions d/handy/dub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "server",
"dependencies": {
"handy-httpd": "~>7.1.0"
},
"license": "MIT"
}
21 changes: 21 additions & 0 deletions d/handy/source/app.d
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();
}
3 changes: 3 additions & 0 deletions d/lighttp/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
github: Kripth/lighttp
version: 0.5
7 changes: 7 additions & 0 deletions d/lighttp/dub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "server",
"dependencies": {
"lighttp": "~>0.5.4"
},
"license": "MIT"
}
10 changes: 10 additions & 0 deletions d/lighttp/dub.selections.json
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"
}
}
29 changes: 29 additions & 0 deletions d/lighttp/source/app.d
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 = "";
}
}
2 changes: 1 addition & 1 deletion java/quarkus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>3.2.0.Final</quarkus.platform.version>
<quarkus.platform.version>3.2.2.Final</quarkus.platform.version>

</properties>
<dependencyManagement>
Expand Down
6 changes: 3 additions & 3 deletions javascript/stricjs/app.ts
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());
3 changes: 2 additions & 1 deletion javascript/stricjs/package.json
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"
}
}
2 changes: 1 addition & 1 deletion nim/Dockerfile
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
Expand Down
2 changes: 1 addition & 1 deletion nim/happyx/config.yaml
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
6 changes: 1 addition & 5 deletions nim/happyx/server.nim
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"
9 changes: 6 additions & 3 deletions nim/happyx/server.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@

description = "Macro-oriented asynchronous web-framework written with ♥"
author = "HapticX"
version = "1.7.0"
license = "GNU GPLv3"
version = "1.10.0"
license = "MIT"
srcDir = "src"
installExt = @["nim"]
bin = @["hpx"]

# Dependencies

requires "happyx >= 1.7 & < 1.8"
requires "happyx >= 1.10 & < 1.11"
requires "cligen"
requires "regex"
requires "httpx"
requires "microasynchttpserver"
requires "httpbeast"
requires "illwill"
requires "nimja"
requires "websocket"
requires "websocketx"
2 changes: 1 addition & 1 deletion php/slim-roadrunner/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"slim/slim": "~4.11.0",
"slim/slim": "~4.12.0",
"slim/psr7": "@stable",
"spiral/roadrunner-cli": "@stable",
"spiral/roadrunner-http": "@stable"
Expand Down
2 changes: 1 addition & 1 deletion php/slim-roadrunner/config.yaml
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
Expand Down
2 changes: 1 addition & 1 deletion php/slim-swoole/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"slim/slim": "~4.11.0",
"slim/slim": "~4.12.0",
"slim/psr7": "@stable",
"chubbyphp/chubbyphp-swoole-request-handler": "@stable"
}
Expand Down
2 changes: 1 addition & 1 deletion php/slim-swoole/config.yaml
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
Expand Down
Loading

0 comments on commit c226d03

Please sign in to comment.