Sitemap
Chevi

Computing & cooking. Clear and rigorous information with a strong and unwavering ethical commitment. Writing in spanish at bitácora.es since 2017.

Member-only story

The Hybrid

--

I was very satisfied with the development experience provided by React + Go + PostgreSQL: scalable applications, written with clarity and readability, whose content can be updated without a visible reload in the browser. The dream of any full-stack. However, the stack in question has an issue: it generates programmes that are not indexed by Google, Bing, Yahoo, DuckDuckGo, etc.

So, at the end of last month, I got to work and rewrote the application, this time using the Next framework with support for Server Side Rendering, aiming to provide a reasonable solution to the problem of search engine presence. It took me barely one or two weeks. Most of the code I had written earlier could be reused because Next is based on React. Changes?

Press enter or click to view image in full size
Photo: Ketut Subiyanto

Well, Next’s routing is based on the organisation of folders within the app directory, pages rendered on the client-side require a "use client" at the first line of code, parametrized dynamic server-side pages — when they are not updated too often — need a function called generateStaticParams() which is used to prerender their content every revalidate seconds, and finally — but not least — the application is served through Node:

import express, { Request, Response } from "express";
import next from "next";

const app = next();
const handle = app.getRequestHandler();

app.prepare().then(() => {

const server = express()…

--

--

José Vicente del Valle Fayos
José Vicente del Valle Fayos

Written by José Vicente del Valle Fayos

He could have become a hedgehog tamer or a cava cork collector, but instead, he had the bright idea to study computer science.

Chevi
Chevi

Published in Chevi

Computing & cooking. Clear and rigorous information with a strong and unwavering ethical commitment. Writing in spanish at bitácora.es since 2017.