1.0.16 • Published 4 years ago

@microserv/app-next v1.0.16

Weekly downloads
11
License
MIT
Repository
-
Last release
4 years ago

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.

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago