Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

ZlyntLab/the-ref-framework

Repository files navigation

REF

The React Engine Framework for Express

NOTE: This framework is not ready for production and for now, is just a Proof of Concept. Soon it will be ready for production

About

REF is a template engine for Express, making Express able to provide server-side rendered React.

Features:

  • Server-side rendering

Installing

npm i the-ref-framework

Example

Model-View-Controller using Express and REF (Github repo here)

How to connect REF to Express server

import express from "express";
import RenderEngine from "the-ref-framework";
import path from "path";

const app = express();
const PORT = 3000;

const viewsFolderPath: string = __dirname + "/views";

new RenderEngine({
  viewsPath: viewsFolderPath,
  errorMessage: "An error happened while loading this page.",
  jsxOrTsx: "TypeScript XML",
  expressApp: app,
});

app.get("/", function (req, res) {
  res.render("root");
});

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

About

React Engine Framework for Express

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published