Skip to content

Commit c8b2415

Browse files
committed
init 🔥
1 parent 6204c90 commit c8b2415

File tree

9 files changed

+10342
-2
lines changed

9 files changed

+10342
-2
lines changed

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"git.ignoreLimitWarning": true
3+
}

README.md

+42-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,42 @@
1-
# nextjs-json-api-route
2-
:fire: :rocket: Building a Next.js json api route
1+
<center>
2+
<img src="https://og-image.now.sh/Building%20a%20**Next.js**%20json%20api%20route.png?theme=light&md=1&fontSize=100px&images=https%3A%2F%2Fassets.zeit.co%2Fimage%2Fupload%2Ffront%2Fassets%2Fdesign%2Fnextjs-black-logo.svg">
3+
<p align="center">
4+
<a href="http://makeapullrequest.com"><img src="https://img.shields.io/badge/PR(s)-welcome-brightgreen.svg?style=flat-square" alt="Make a pull request."></a>
5+
<a href="http://www.firsttimersonly.com"><img src="https://img.shields.io/badge/first--timers--only-friendly-blue.svg?style=flat-square" alt="First-timers Friendly"></a>
6+
</p>
7+
</center>
8+
9+
# Nextjs-json-api-route
10+
Building a Next.js json api route
11+
12+
## Get Started
13+
14+
Demo: https://nextjs-json-api-route.now.sh
15+
16+
Clone the repository:
17+
18+
```bash
19+
git clone https://github.com/Developerayo/nextjs-json-api-route.git && cd nextjs-json-api-route
20+
```
21+
22+
23+
Install the dependencies:
24+
25+
```bash
26+
npm i next
27+
```
28+
29+
To start the project run following command in your terminal:
30+
31+
```bash
32+
npx next
33+
```
34+
35+
Run the app in the development mode.<br>
36+
Open **[http://localhost:3000](http://localhost:3000)** to view it in the browser.
37+
38+
The page will reload if you make edits.<br>
39+
You will also see any lint errors in the console.
40+
41+
# License
42+
[GNU](LICENSE)

data.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"message": "Next API route"
3+
}

now.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"version": 2,
3+
"name": "NextJS Json Api Route",
4+
"alias": "nextjs-json-api-route.now.sh",
5+
"builds": [
6+
{"src": "package.json", "use": "@now/static-build", "config": {"distDir": "build"}}
7+
],
8+
"routes": [
9+
{"src": "/static/(.*)", "headers": {"cache-control": "s-maxage=31536000,immutable"}, "dest": "/static/$1"},
10+
{"src": "/favicon.ico", "dest": "/favicon.ico"},
11+
{"src": "/asset-manifest.json", "dest": "/asset-manifest.json"},
12+
{"src": "/manifest.json", "dest": "/manifest.json"},
13+
{"src": "/precache-manifest.(.*)", "dest": "/precache-manifest.$1"},
14+
{"src": "/service-worker.js", "headers": {"cache-control": "s-maxage=0"}, "dest": "/service-worker.js"},
15+
{"src": "/(.*)", "headers": {"cache-control": "s-maxage=0"}, "dest": "/index.html"}
16+
]
17+
}

0 commit comments

Comments
 (0)