Skip to content

Commit

Permalink
[remix] Add custom entry.server for Vite test (#11408)
Browse files Browse the repository at this point in the history
Adds an e2e test fixture which tests that a custom `app/entry.server` file is supported.

Related to:

* vercel/remix#85
* vercel/remix#89
  • Loading branch information
TooTallNate committed Apr 10, 2024
1 parent cddf3fa commit b58dcc5
Show file tree
Hide file tree
Showing 11 changed files with 7,971 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .changeset/clean-lobsters-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules

/build
.env
.vercel
38 changes: 38 additions & 0 deletions packages/remix/test/fixtures-vite/05-custom-entry-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Remix

This directory is a brief example of a [Remix](https://remix.run/docs) site that can be deployed to Vercel with zero configuration.

To get started, run the Remix cli with this template

```sh
npx create-remix@latest --template vercel/vercel/examples/remix
```

## Deploy Your Own

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/remix&template=remix)

_Live Example: https://remix-run-template.vercel.app_

You can also deploy using the [Vercel CLI](https://vercel.com/docs/cli):

```sh
npm i -g vercel
vercel
```

## Development

To run your Remix app locally, make sure your project's local dependencies are installed:

```sh
npm install
```

Afterwards, start the Remix development server like so:

```sh
npm run dev
```

Open up [http://localhost:5173](http://localhost:5173) and you should be ready to go!
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default function handleRequest(
request: Request,
) {
return new Response("This is a custom entry.server response");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {
Links,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import { Analytics } from "@vercel/analytics/react";

export function Layout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<Meta />
<Links />
</head>
<body>
{children}
<ScrollRestoration />
<Scripts />
<Analytics />
</body>
</html>
);
}

export default function App() {
return <Outlet />;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import type { MetaFunction } from "@vercel/remix";

export const meta: MetaFunction = () => {
return [
{ title: "New Remix App" },
{ name: "description", content: "Welcome to Remix!" },
];
};

export default function Index() {
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.8" }}>
<h1>Welcome to Remix</h1>
<ul>
<li>
<a
target="_blank"
href="https://remix.run/tutorials/blog"
rel="noreferrer"
>
15m Quickstart Blog Tutorial
</a>
</li>
<li>
<a
target="_blank"
href="https://remix.run/tutorials/jokes"
rel="noreferrer"
>
Deep Dive Jokes App Tutorial
</a>
</li>
<li>
<a target="_blank" href="https://remix.run/docs" rel="noreferrer">
Remix Docs
</a>
</li>
</ul>
</div>
);
}

0 comments on commit b58dcc5

Please sign in to comment.