Skip to content

Commit 154ad1e

Browse files
committed
Código de la 3a sesión sobre NextJS
1 parent d3a1a02 commit 154ad1e

25 files changed

+4448
-0
lines changed

2023-06-15/next3/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
HOLA_QUE_TAL=blisblas
2+
NEXT_PUBLIC_HOLA_QUE_TAL=blosblus

2023-06-15/next3/.env.development

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ENTORNO=Desarrollo

2023-06-15/next3/.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ENTORNO=Producción

2023-06-15/next3/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

2023-06-15/next3/.gitignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env*.local
29+
30+
# vercel
31+
.vercel
32+
33+
# typescript
34+
*.tsbuildinfo
35+
next-env.d.ts

2023-06-15/next3/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
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).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
# or
12+
pnpm dev
13+
```
14+
15+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
16+
17+
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
18+
19+
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
20+
21+
## Learn More
22+
23+
To learn more about Next.js, take a look at the following resources:
24+
25+
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
26+
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
27+
28+
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
29+
30+
## Deploy on Vercel
31+
32+
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.
33+
34+
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { writeFile } from "fs/promises";
2+
import { NextRequest, NextResponse } from "next/server";
3+
4+
export async function GET(req: NextRequest) {
5+
return NextResponse.json({ error: "You should call with POST" });
6+
}
7+
8+
export async function POST(req: NextRequest) {
9+
const formData = await req.formData();
10+
const filename = formData.get('filename');
11+
if (filename === null) {
12+
return NextResponse.json({ error: "Missing 'filename'" }, {
13+
status: 400,
14+
});
15+
}
16+
const content = formData.get('content');
17+
if (content === null) {
18+
return NextResponse.json({ error: "Missing 'content'" }, {
19+
status: 400,
20+
});
21+
}
22+
23+
await writeFile(filename.toString(), content.toString());
24+
return NextResponse.json({ ok: true });
25+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
export default async function Page() {
3+
return <main>
4+
<h1 className="text-2xl font-bold">Dashboard</h1>
5+
</main>
6+
}

2023-06-15/next3/app/favicon.ico

25.3 KB
Binary file not shown.

2023-06-15/next3/app/globals.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+

0 commit comments

Comments
 (0)