Skip to content
This repository was archived by the owner on Jan 28, 2025. It is now read-only.

Files

Latest commit

 

History

History
37 lines (27 loc) · 1.27 KB

installation.md

File metadata and controls

37 lines (27 loc) · 1.27 KB
id title sidebar_label
installation
Installation
Installation

See the steps below to get started and install the Serverless Nextjs component in your NextJS project and then deploy

  1. Create a NextJS project: npx create-next-app my-nextjs-app
  2. (Optional) Once it is created, you can run the app locally: npm run dev
  3. (Optional) Open http://localhost:3000 with your browser to see the application
  4. Create a serverless.yml file at the root of your project and add your NextJS application as shown below:
# serverless.yml

myNextApplication:
  component: "@sls-next/serverless-component@1.19.0" # or specify latest stable or alpha version found in https://www.npmjs.com/package/@sls-next/serverless-component
  1. It is recommended you pin the latest stable version of serverless-next.js component. Check out the versions here
  2. Create a .env file at the root of your project to spcify AWS credentials:
#.env

AWS_ACCESS_KEY_ID=accesskey
AWS_SECRET_ACCESS_KEY=accesskeysecret
  1. And simply deploy by running the command below from your project root:
$ serverless

If you get an error during the deployment process, checkout the FAQ.