Skip to content

Commit 0051d03

Browse files
committed
trying to fix CORS
1 parent bc1a34a commit 0051d03

2 files changed

Lines changed: 13 additions & 46 deletions

File tree

README.MD

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1 @@
1-
# Vue.js Project with Firebase and Tailwind CSS
2-
3-
A modern Vue.js project setup with:
4-
- Vue 3 with TypeScript
5-
- Vite as build tool
6-
- Tailwind CSS for styling
7-
- Firebase integration
8-
- pnpm as package manager
9-
10-
## Project Setup
11-
12-
```bash
13-
pnpm install
14-
```
15-
16-
### Compile and Hot-Reload for Development
17-
18-
```bash
19-
pnpm run dev
20-
```
21-
22-
### Compile and Minify for Production
23-
24-
```bash
25-
pnpm run build
26-
```
27-
28-
### Firebase Configuration
29-
30-
1. Create a Firebase project at https://console.firebase.google.com/
31-
2. Copy your Firebase configuration from the project settings
32-
3. Update the `src/firebase.ts` file with your Firebase configuration
33-
34-
## Tech Stack
35-
36-
- Vue 3
37-
- TypeScript
38-
- Vite
39-
- Tailwind CSS
40-
- Firebase
41-
- pnpm
1+
https://things-to-complete.web.app/

functions/src/index.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@
77
* See a full list of supported triggers at https://firebase.google.com/docs/functions
88
*/
99

10-
import {onRequest} from "firebase-functions/v2/https";
10+
import { onRequest } from "firebase-functions/v2/https";
1111
import * as logger from "firebase-functions/logger";
12+
import * as express from "express";
13+
1214

1315
// Start writing functions
1416
// https://firebase.google.com/docs/functions/typescript
1517

16-
export const helloWorld = onRequest((request, response) => {
17-
logger.info("Hello logs!", {structuredData: true});
18-
response.send({message: "Hello from Firebase with TypeScript!"});
19-
});
18+
export const helloWorld = onRequest(
19+
{ cors: [/^https:\/\/things-to-complete\.web\.app\/.*/] },
20+
(request: express.Request, response: express.Response) => {
21+
logger.info("Hello logs!", { structuredData: true });
22+
response
23+
.status(200)
24+
.send({ message: "Hello from Firebase with TypeScript * cors!" });
25+
}
26+
);

0 commit comments

Comments
 (0)