@microserv/app-next
v1.0.16
Published
```shell yarn add @microserv/core @microserv/app-next ```
Downloads
6
Readme
title: '@microserv/app-next' custom_edit_url: https://github.com/iamvishnusankar/microserv/edit/master/packages/app-next/README.md
Working demo can be found here : Hello World NextJS
Installation
yarn add @microserv/core @microserv/app-next
Install type definitions.
yarn add @types/react @types/react-dom -D
Add Scripts
{
"dev": "microserv develop",
"start": "NODE_ENV=production microserv start",
"build": "NODE_ENV=production microserv build"
}
Create Entry File
import { MicroServ } from '@microserv/core'
import { NextApp } from '@microserv/app-next'
export default new MicroServ({
apps: [
new NextApp({
dir: 'app' /** Directory of nextjs app**
})
]
})
NextJS config
Create a folder named app
and add next.config.js
with the following content.
module.exports = {
distDir: '../build/www'
}
NextJS Index Page
import React from 'react'
const HomePage: React.FC = () => {
return (
<div>
<h1>✅ Hello World NextJS ✨</h1>
</div>
)
}
export default HomePage
Run App
yarn dev
The app will be running at http://localhost:3000
.