4 ms·
There's `dotnet run` now. You can: vim projects/example.cs var builder = WebApplication.CreateBuilder(args); var app = builder.Build(); app.MapGet
by hu3 1y ago
There's `dotnet run` now. You can:
vim projects/example.cs
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.Run();
dotnet run projects/example.cs
Not the same as PHP I know, but it's close enough for me.
- DoctorOW 1y agoI'm glad it works for you but I guess that doesn't really cover the use case I was talking about because I want to have a bunch of these. As an example, I threw together a quick web hook processor, data from one service reformatted to fit another. I don't really need to spin up a whole new VPS for an endpoint that'll only be hit once or twice a week, so this is the workflow for doing that on the server I already have. PHP: - vim projects/webhook.php C#: - vim projects/webhook.cs - Assign a port number - Reconfigure Nginx/Caddy to serve that port number - Reconfigure systemd to dotnet run projects/webhook.cs on startup