minimal-apis.github.io
minimal-apis.github.io copied to clipboard
Add a section that shows how concepts in other frameworks apply using minimal APIs
What would you like see:
- [x] Documentation
- [ ] Sample
- [ ] Tutorial
What kind of content are you looking for ?
We should have a section on the site that lists a couple of top level concepts in various frameworks (routing, middleware, logging, dependency injection (where applicable)), as a way to quickly get somebody that is already using an existing framework up to speed with similar concepts in minimal.
For example:
Express
Routes
// GET method route
app.get('/', function (req, res) {
res.send('GET request to the homepage')
})
// POST method route
app.post('/', function (req, res) {
res.send('POST request to the homepage')
})
app.MapGet("/", () => "GET request to the homepage");
app.MapPost("/", () => "POST request to the homepage");
Route parameters
app.get('/users/:userId/books/:bookId', function (req, res) {
res.send(req.params)
})
app.MapGet("/users/{userId}/books/{bookId}", (int userId, int bookId) => {
return new { userId, bookId };
});
Middleware
var express = require('express')
var app = express()
app.use(function (req, res, next) {
console.log('Time:', Date.now())
next()
})
var app = WebApplication.Create(args);
app.Use((context, next) =>
{
Console.WriteLine($"Time: {DateTime.Now}");
return next(context);
});
StaticFiles
var express = require('express')
var app = express()
app.use(express.static('public', options))
var app = WebApplication.Create(args);
app.UseStaticFiles();
Isn't this already covered in the current quick start https://minimal-apis.github.io/quickstart/quickstart.html
There's no plan to cover other frameworks in that set. This is about having a "if you know framework X" here's how you do it in minimal comparison
What about something like this on the homepage under features? I don't know if we should do entire section. TBH I don't know where this would be go in the page flow
Maybe I could add an about page ...
I think it should be a different page. One per framework. One for express and one for flask, and maybe a golang framework.
😑 I am not sure about this. But we could add a section under the quick starts. But it may get lost. Right now this what we have Top menus
- Quick starts
-
App Overview by @glennc
-
Then we will have quick guides on the following topics
-
- Tutorials
- Samples
- MS Docs
Example https://hapi.dev/tutorials/expresstohapi/?lang=en_US