Saturday, August 22, 2026

Express.js => Fiber.go

 From Express to Fiber: A Translation Guide | Fiber

Fiber's API was inspired by Express, and it shows: routes look the same, parameters use the same :name syntax, middleware chains work the way you expect. If you know Express, you already know most of Fiber - you just do not know the spelling yet.

// Express
const express = require('express');
const app = express();

app.get('/', (req, res) => {
res.send('Hello, World!');
});

app.listen(3000);
// Fiber v3
package main

import "github.com/gofiber/fiber/v3"

func main() {
app := fiber.New()

app.Get("/", func(c fiber.Ctx) error {
return c.SendString("Hello, World!")
})

app.Listen(":3000")
}


No comments:

Post a Comment