Next.js is a framework for server-render or statically-exported React apps. In this article, I would like to introduce basic knowledge for Next.js.
🎃 Install
cd /project/path/to/ |
🎂 Server Side Support for Clean URLs
Please add Express.js:
yarn add express |
Then create a file server.js
in your app and add following content:
const express = require("express"); |
In addtion, please add pages/post.js
and write following code:
export default props => <h1>post page id: {props.url.query.id} in next.jsh1>; |
After modifying, please update package.json
:
{ |
🖥 Recommended VPS Service
VULTR provides high performance cloud compute environment for you.
Vultr has 15 data-centers strategically placed around the globe, you can use a VPS with 512 MB memory for just $ 2.5 / month ($ 0.004 / hour).
In addition, Vultr is up to 4 times faster than the competition, so please check it => Check Benchmark Results!!