Skip to content
Render JSX in express
TypeScript JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
__tests__
src
.eslintignore
.eslintrc
.gitattributes
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
LICENSE
index.d.ts
package.json
readme.md
tsconfig.json
yarn.lock

readme.md

jsx-engine

Maintainability Test Coverage FOSSA Status

Install

yarn add jsx-engine

Usage

// server.js
const express = require('express')
const app = express()
app.engine('jsx', require('jsx-engine'))
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'jsx')
app.get('/', (req, res) => {
  res.render('index')
});
// views/index.js
module.exports = () => {
  return (
    <html lang='en'>
      <head>
        <title>jsx-engine</title>
      </head>
      <body>
        <div>Hey!</div>
      </body>
    </html>
  );
}

License

FOSSA Status

You can’t perform that action at this time.