https://github.com/reactend/reactend-express
React renderer to build Node.js server
https://github.com/reactend/reactend-express
nodejs nodejs-server react
Last synced: 3 months ago
JSON representation
React renderer to build Node.js server
- Host: GitHub
- URL: https://github.com/reactend/reactend-express
- Owner: reactend
- Created: 2021-02-07T02:19:40.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-20T00:49:50.000Z (over 2 years ago)
- Last Synced: 2025-10-05T04:44:44.891Z (3 months ago)
- Topics: nodejs, nodejs-server, react
- Language: JavaScript
- Homepage: https://reactend.herokuapp.com/
- Size: 390 KB
- Stars: 400
- Watchers: 8
- Forks: 18
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-list - reactend-express
README
# Reactend / Express
React-like http-server on Nodejs
### 🕹 [Playground on repl.it](https://repl.it/@orkhanjafarov/reactend-playground?v=1)
### 📄 [Reactend Template](https://github.com/gigantz/reactend-template)

## What's that?
- Node.js http-server based on React-Components
- Express.js inside
- Get, Post, Delete and etc. components to use router method
- `Get(render)` and `Res.Render` to render your regular React DOM Components
- useContext(ReqResContext) hook to access `req, res`
- Support `styled-components`
- Built-in logger (morgan)
- Middleware component in Router and its Routes
- `handler` prop in Route components to use as regular controller
_and many many features that should be documented..._
## Get started
Run this to create reactend project on your local machine
```
npx create-reactend my-app
```
You choose template (default: basic)
```
npx create-reactend my-app --template faker
```
## Code Example
```js
import React from 'react';
import { resolve } from 'path';
import { registerApp, App, Static, Router, Get, Post, Res, Logger } from '@reactend/express';
const ExpressApp = () => (
console.log(req.originalUrl)}
/>
);
registerApp(ExpressApp);
```
## You can use this way too
```js
import cors from 'cors';
;
```
```js
Shut Up And Take My Money!
} />
```
## Components
_This minor description for now (Docs is on the way)_
`` - App Instance (props: port)
`` - Static route (props: publicPath, path, options)
`` - Router-Provider (props: path)
`, and ...` - Route component (props: path, content,
handler, status)
`` - Middleware (props: handler)
`` - morgan logger (props: mode, disabled)
`` - Response components
`` - Render (props: component)
`` - Response send (props: json, text, contentType)
`` - Response Status (props: statusCode)
`` - Response Send File (props: path, options,
onError)
`` - Redirect (props: path, statusCode)
`` - Redirect (props: length, locale, map)
---
## Contact me
Email me if you have any idea and you would like to be contributor [orkhanjafarovr@gmail.com](mailto:orkhanjafarovr@gmail.com)
Cheers ✨