Socket
Socket
Sign inDemoInstall

the-ref-framework

Package Overview
Dependencies
443
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    the-ref-framework

React Engine Framework for Express


Version published
Maintainers
1
Created

Readme

Source

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}`));

FAQs

Last updated on 01 Feb 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc