@microserv/app-next

1.0.16 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @microserv/app-next

Weekly Downloads

10

Version

1.0.16

License

MIT

Unpacked Size

5.12 kB

Total Files

12

Last publish

Collaborators

  • iamvishnusankar