Create a Page Component: In a Nuxt.js app, any .vue file in the pages/ directory automatically becomes a route. Here’s an example of a simple SSR-enabled page in Vue.
<!-- pages/index.vue -->
<template>
  <div>
    <h1>{{ message }}</h1>
  </div>
</template>
<script>
export default {
  asyncData() {
    return {
      message: 'Hello from Server-Side Rendering!'
    };
  }
};
</script>
asyncData: This method runs before rendering the component, and it is called on both the client and the server, making it perfect for fetching data that you want to render on the server.
Custom Server Configuration (Optional): You can also customize the server configuration. Here’s an example of setting up an Express.js server to handle SSR
const express = require('express');
const { loadNuxt, build } = require('nuxt');
async function start() {
  const app = express();
  const isDev = process.env.NODE_ENV !== 'production';
  const nuxt = await loadNuxt(isDev ? 'dev' : 'start');
  app.use(nuxt.render);
  if (isDev) {
    build(nuxt);
  }
  app.listen(3000, () => {
    console.log('Server is listening on http://localhost:3000');
  });
}
start();
This is a simple way to enable server-side rendering in a Vue.js project using Nuxt.js. The data (in this case, the message) is fetched on the server, which can improve SEO and performance by delivering a fully rendered page on the first load