Skip to content

Commit baf7a1c

Browse files
committed
update to use netlify cli for local
1 parent 3097656 commit baf7a1c

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,5 @@ dist
104104
.tern-port
105105

106106
/public/build
107+
108+
.netlify

README.MD

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,18 @@ You can repeat these steps repository-by-repository if you prefer.
104104

105105
## Local Development
106106

107-
To run the app locally, once cloned, you will need to create an `.env` file in `/api` directory to configure your `ABLY_API_KEY` and `GITHUB_WEBHOOK_SECRET`:
107+
To run the app locally, once cloned, you will need to create an `.env` file in root directory, to configure your `ABLY_API_KEY` and `GITHUB_WEBHOOK_SECRET`:
108108

109109
```bash
110110
ABLY_API_KEY=your-ably-api-key
111111
GITHUB_WEBHOOK_SECRET=a-secret-password-that-you-make-up
112112
```
113113

114-
Local dev uses **vite** as a development server, firstly install the dependencies then run the start script:
114+
Next install the Netlify CLI, to run the serverless functions locally, then install the dependencies and run the start script:
115115

116116
```bash
117-
npm i
117+
npm install netlify-cli -g
118+
npm install
118119
npm run start
119120
```
120121

app/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset='utf-8'>
66
<meta name='viewport' content='width=device-width,initial-scale=1'>
77

8-
<title>GitHub Commit Visualiser by Ably</title>
8+
<title>GitHub Commit Visualizer by Ably</title>
99

1010
<link rel='icon' type='image/png' href='/favicon.ico'>
1111
<link rel='stylesheet' href='/global.css'>

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
"type": "module",
66
"scripts": {
77
"prestart": "cd api && npm install",
8-
"start": "run-p dev:api dev:app",
8+
"start": "netlify dev -c \"npm run dev:app\" --targetPort 8080",
99
"dev:app": "vite",
1010
"dev:api": "npm run start --prefix api",
1111
"test": "vitest run",
1212
"check": "svelte-check --tsconfig ./tsconfig.json",
13+
"start:azure": "run-p dev:api dev:app",
1314
"build:azure": "npx vite build",
1415
"build:netlify": "npx vite build && cd api && npm i && npm run build"
1516
},

0 commit comments

Comments
 (0)