Skip to content

Commit

Permalink
new chage
Browse files Browse the repository at this point in the history
  • Loading branch information
Tushil-moon committed Nov 7, 2024
1 parent 76313b7 commit 9427347
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
4 changes: 1 addition & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"cors": "^2.8.5",
"jquery": "^3.7.1",
"json-server": "^1.0.0-beta.2",
"ngx-editor": "^18.0.0",
Expand Down
4 changes: 4 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
const jsonServer = require('json-server');
const cors = require('cors'); // Import the cors package
const server = jsonServer.create();
const router = jsonServer.router('db.json'); // Points to db.json file
const middlewares = jsonServer.defaults();

// Enable CORS for all routes
server.use(cors()); // Use the cors middleware to handle CORS

server.use(middlewares);
server.use(router);

Expand Down
2 changes: 1 addition & 1 deletion src/app/Services/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class AuthService {
/**
* Actual api to performing every request
*/
private apiURL = 'http://localhost:3000/users';
private apiURL = 'https://task-6bw61451s-tushils-projects.vercel.app/users';

/**
* Get Perticular user by sending GET request using Id as query param..
Expand Down
2 changes: 1 addition & 1 deletion src/app/Services/task/task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class TaskService {
/**
* Actual api to performing every request
*/
private apiURL = 'http://localhost:3000/tasks';
private apiURL = 'https://task-6bw61451s-tushils-projects.vercel.app/tasks';

/**
* Behaviour subject that handle the triggerd of method
Expand Down
15 changes: 15 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"builds": [
{
"src": "server.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/api/(.*)",
"dest": "server.js"
}
]
}

0 comments on commit 9427347

Please sign in to comment.