Skip to content

Commit 1f721b9

Browse files
authored
Update README.md (#5)
* Update README.md * Add blank line at eof
1 parent b6c89a5 commit 1f721b9

File tree

3 files changed

+32
-7
lines changed

3 files changed

+32
-7
lines changed

.env.local.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Environment variables secret available on server side
2+
3+
# add your ipify api key below
4+
IPIFY_API_KEY=your_secret_api_key_here
5+
6+
# Public Environment variables available on client side
7+
NEXT_PUBLIC_LOCAL_DEVELOPMENT=true
8+
NEXT_PUBLIC_HOSTNAME=localhost
9+
NEXT_PUBLIC_PORT=3000
10+
NEXT_PUBLIC_HOST=http://$NEXT_PUBLIC_HOSTNAME:$NEXT_PUBLIC_PORT

README.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
22

3+
This project is part of the [Frontend Mentor Challenge - IP address tracker](https://www.frontendmentor.io/challenges/ip-address-tracker-I8-0yYAH0)
4+
5+
![Design preview for the IP address tracker coding challenge](./desktop-preview.jpg)
36
## Getting Started
47

5-
First, run the development server:
8+
First create a file `.env.local` in the root of the project. Copy the environment variables from `.env.local.example` to your `.env.local` and edit them per your needs.
9+
10+
You will have something like this:
11+
```bash
12+
# Environment variables secret available on server side
13+
14+
# add your ipify api key below
15+
IPIFY_API_KEY=your_secret_api_key_here
16+
17+
# Public Environment variables available on client side
18+
NEXT_PUBLIC_LOCAL_DEVELOPMENT=true
19+
NEXT_PUBLIC_HOSTNAME=localhost
20+
NEXT_PUBLIC_PORT=3000
21+
NEXT_PUBLIC_HOST=http://$NEXT_PUBLIC_HOSTNAME:$NEXT_PUBLIC_PORT
22+
```
23+
24+
Then, run the development server:
625

726
```bash
827
npm run dev
@@ -12,12 +31,6 @@ yarn dev
1231

1332
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
1433

15-
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
16-
17-
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
18-
19-
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
20-
2134
## Learn More
2235

2336
To learn more about Next.js, take a look at the following resources:
@@ -32,3 +45,5 @@ You can check out [the Next.js GitHub repository](https://github.com/vercel/next
3245
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
3346

3447
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
48+
49+
**Have fun!** 🚀

desktop-preview.jpg

73.8 KB
Loading

0 commit comments

Comments
 (0)