@vercel/remix-entry-server
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@vercel/remix-entry-server

This package is meant for use within Remix applications when deploying to Vercel. It provides implementations for the app/entry.server.tsx file for both the Node.js Serverless Runtime and the Edge Runtime. The implementations are configured to handle streaming responses.

Usage

Make sure @vercel/remix-entry-server is installed with your package manager of choice, then replace your app/entry.server.tsx file with the following:

// `app/entry.server.tsx`

import handleRequest from '@vercel/remix-entry-server';
import { RemixServer } from '@remix-run/react';
import type { EntryContext } from '@remix-run/server-runtime';

export default function (
  request: Request,
  responseStatusCode: number,
  responseHeaders: Headers,
  remixContext: EntryContext
) {
  const remixServer = <RemixServer context={remixContext} url={request.url} />;
  return handleRequest(
    request,
    responseStatusCode,
    responseHeaders,
    remixServer
  );
}

Readme

Keywords

none

Package Sidebar

Install

npm i @vercel/remix-entry-server

Weekly Downloads

425

Version

0.1.1

License

Apache-2.0

Unpacked Size

19.9 kB

Total Files

9

Last publish

Collaborators

  • ijjk
  • quietshu
  • vercel-release-bot
  • snokohn
  • nick.tracey
  • matheuss
  • chriswdmr
  • matt.straka
  • zeit-bot