Skip to content

Commit

Permalink
api as url
Browse files Browse the repository at this point in the history
  • Loading branch information
bpiv400 committed Jul 19, 2023
1 parent 9f77999 commit 4250236
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next

## Getting Started

First, run the development server:
First, ensure you have a `.env.development.local` file with the following environment variables:

* `NEXT_PUBLIC_API_URL`: Root URL of the Skip API server the frontend will query. The two acceptable values are:
* `https://api.skip.money/v1`: The stable, production API server
* `https://solve-dev.skip.money/v1`: The nightly, unstable dev server used for testing and previewing new functionality
(An example has been included in the repo under example.env). You *MUST* copy this to `env.development.local`. Internally, we use `env.development.local` to develop against the nightly API and `env.production.local` to develop against the stable one.

## Develop

Run the development server:

```bash
npm run dev
Expand All @@ -18,6 +27,16 @@ You can start editing the page by modifying `app/page.tsx`. The page auto-update

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Build and Run

```bash
npm run build && npm run start
# or
yarn build && yarn start
# or
pnpm build && pnpm start
```

## Learn More

To learn more about Next.js, take a look at the following resources:
Expand Down
5 changes: 5 additions & 0 deletions example.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# production api
NEXT_PUBLIC_API_URL=https://api.skip.money/v1

# development API
# NEXT_PUBLIC_API_URL=https://solve-dev.skip.money/v1
3 changes: 1 addition & 2 deletions src/solve/api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from "axios";
import { Affiliate, Chain, MultiChainMsg, Operation, SwapVenue } from "./types";

const API_URL = "https://api.skip.money/v1";

const API_URL = `${process.env.NEXT_PUBLIC_API_URL}`;
interface GetChainsResponse {
chains: Chain[];
}
Expand Down

0 comments on commit 4250236

Please sign in to comment.