Skip to content
This repository has been archived by the owner on Feb 28, 2022. It is now read-only.

yhuard/test-remix-typescript-netlify

Repository files navigation

Welcome to Remix!

Netlify Setup

  1. Install the Netlify CLI:
npm i -g netlify-cli

If you have previously installed the Netlify CLI, you should update it to the latest version:

npm i -g netlify-cli@latest
  1. Sign up and log in to Netlify:
netlify login
  1. Create a new site:
netlify init

Development

The Netlify CLI starts your app in development mode, rebuilding assets on file changes.

npm run dev

Open up http://localhost:3000, and you should be ready to go!

Deployment

There are two ways to deploy your app to Netlify, you can either link your app to your git repo and have it auto deploy changes to Netlify, or you can deploy your app manually. If you've followed the setup instructions already, all you need to do is run this:

$ npm run build
# preview deployment
$ netlify deploy

# production deployment
$ netlify deploy --prod

I learned...

  • how to set up Remix with Netlify + GitHub to automatically deploy on every push

Personal notes

Netlify functions run on AWS with a different runtime: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html

I ran netlify env:set AWS_LAMBDA_JS_RUNTIME nodejs14.x in order to use Node.js v14. I should probably align the local version here too.