Next.js & React - The Complete Guide (incl. Two Paths!) | Udemy
by Max (Academind)
Setup - Create a Next.js App | Learn Next.js
next-learn-starter/install.md at master · vercel/next-learn-starter · GitHub
using React rendering on server (node.js) is quite simple:
Component.js var React = require('react'); module.exports = React.createClass({ render: function() { return React.createElement('h1', null, 'Hello World!'); } }); var express = require('express'); var app = express(); var React = require('react'); var ReactDOMServer = require('react-dom/server'); var Component = require('./Component.jsx'); app.get('/', function(request, response) { var html = ReactDOMServer.renderToString( React.createElement(Component) ); response.send(html); }); var PORT = 3000; app.listen(PORT, function() { console.log('http://localhost:' + PORT); });
deploy: Develop. Preview. Ship. For the best frontend teams – Vercel
(developers of next.js)
alternative:
How to Deploy Next.js Sites to Netlify — 5-Minute Tutorial
No comments:
Post a Comment