Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floatdrop/express-render-jsx
Render jsx files from express
https://github.com/floatdrop/express-render-jsx
Last synced: 22 days ago
JSON representation
Render jsx files from express
- Host: GitHub
- URL: https://github.com/floatdrop/express-render-jsx
- Owner: floatdrop
- License: mit
- Created: 2015-07-17T20:47:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-10T18:15:36.000Z (over 7 years ago)
- Last Synced: 2024-10-26T21:12:06.597Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# express-render-jsx [![Build Status](https://travis-ci.org/floatdrop/express-render-jsx.svg?branch=master)](https://travis-ci.org/floatdrop/express-render-jsx)
> Render jsx templates from Express
## Install
```
$ npm install --save express-render-jsx
```## Usage
```js
var app = express();
var expressRenderJsx = require('express-render-jsx');app.set('views', __dirname + '/views');
app.set('view engine', 'jsx');
app.engine('jsx', expressRenderJsx());
```Your views should be node modules that export a React component. Let's assume you have this file in `views/index.jsx`:
```jsx
var React = require('react');var HelloMessage = React.createClass({
render: function() {
returnHello {this.props.name};
}
});module.exports = HelloMessage;
```## License
MIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)