Skip to content

Commit

Permalink
Improve local setup and README (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
msalihaltun authored May 9, 2024
1 parent ebfc1a6 commit 240551f
Show file tree
Hide file tree
Showing 6 changed files with 292 additions and 4 deletions.
7 changes: 7 additions & 0 deletions skyvern-frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
VITE_API_BASE_URL=http://localhost:8000/api/v1

# server to load artifacts from file URIs
VITE_ARTIFACT_API_BASE_URL=http://localhost:9090

# your api key - for x-api-key header
VITE_SKYVERN_API_KEY=
26 changes: 26 additions & 0 deletions skyvern-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Skyvern Frontend](#skyvern-frontend)
- [Quickstart](#quickstart)
- [Populate env file](#populate-env-file)
- [Development](#development)
- [Build for production](#build-for-production)
- [Preview the production build locally](#preview-the-production-build-locally)
Expand All @@ -10,6 +12,30 @@

# Skyvern Frontend

## Quickstart

### Populate env file

Copy example env file:

```sh
cp .env.example .env
```

Populate `VITE_SKYVERN_API_KEY` with your API key.

Then run:

```sh
npm install
```

```sh
npm start
```

This will build the app and serve from port 8080.

## Development

```sh
Expand Down
25 changes: 25 additions & 0 deletions skyvern-frontend/localServer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { createServer } from "http";
import handler from "serve-handler";
import open from "open";

const port = 8080;
const url = `http://localhost:${port}`;

const server = createServer((request, response) => {
// You pass two more arguments for config and middleware
// More details here: https://github.com/vercel/serve-handler#options
return handler(request, response, {
public: "dist",
rewrites: [
{
source: "**",
destination: "/index.html",
},
],
});
});

server.listen(8080, async () => {
console.log(`Running at ${url}`);
await open(url);
});
Loading

0 comments on commit 240551f

Please sign in to comment.