Skip to content

Choosing between backend frameworks

Posted on:June 1, 2023 at 11:22 AM

While most people wonder what frontend framework, like Vue, Svelte or React, they should choose, now we are jumping on the server side. But first, we should choose which language we will develop with.

Every programming language has a backend solution: Javascript has Express for NodeJS, C# has Blazor, PHP has CodeIgniter and Laravel, and Java has Spring. If we stick with js because we will develop with a single language for both frontend and backend.

Express is a very simple library. YOu can create a basic server like below:

const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;

app.get('/', (req, res) => {
    res.send("<h1>Welcome!</h1>");
}

app.listen(PORT, () => {
    console.log(`Listening on: ${PORT}`);
})

This creates an endpoint at localhost:3000 that will display the HTML code. Express has included middleware, static routing, template engines and other http utilities.

If we migrate to PHP, Laravel is a whole mansion compared to the house of Express. It is configured for creating heavy websites, uses MySQL by default and has a lot of batteries included.

Blazor is a full-stack framework, meaning that it can be used for writing apps on both front and back end. It can also leverage the power of WebAssembly and SPAs which reduces the use of the server.

@page "/counter"
@inherits ClassName

<p>
    Value of prop is: @property
</p>