neobiz-express

3.0.1 • Public • Published

read example.js file

import express from "express";
import neoex from "neobiz-express";

const app = new express();
neoex(app, "./view"); //@params expressApp, path2view

app.get("/", (req, res) => {
  // no need to write .js, actually don't
  res.render("landing.v", { title: "data" });
});
res.render(
  // views
  ({ username }) => ({
    h1: { text: "Hello world! " + username },
  }),
  // passing value
  {
    template: "t.v", //use template
    title: "on the go",
    username: "dim24",
  }
);

templates

res.render("landing.v", { title: "data", template: "main.v" });

main.js

module.exports = (contents, { title }) => ({
  head: { title: { text: title } },
  body: contents, //child
});

Package Sidebar

Install

npm i neobiz-express

Weekly Downloads

0

Version

3.0.1

License

ISC

Unpacked Size

3.72 kB

Total Files

6

Last publish

Collaborators

  • dim24