Add vercel.json

This commit is contained in:
Hazem Krimi
2023-05-06 18:49:24 +01:00
parent eee11259db
commit 6a50a707d9
2 changed files with 16 additions and 16 deletions
+13 -16
View File
@@ -2,13 +2,7 @@ import jwtDecode from 'jwt-decode';
import { useEffect } from 'react';
import { Routes, Route, Navigate } from 'react-router-dom';
import { useLazyQuery, useReactiveVar } from '@apollo/client';
import {
Protected,
Public,
Navbar,
Sidebar,
Spinner,
} from './components';
import { Protected, Public, Navbar, Sidebar, Spinner } from './components';
import { roleVar, tokenVar, userVar } from './graphql/state';
import {
AdditionalInfo,
@@ -89,15 +83,18 @@ const App = () => {
</>
)}
<Routes>
<Route path='/' element={
<Protected>
{role !== 'admin' ? (
<Navigate to='/project' />
) : (
<Navigate to='/clients' />
)}
</Protected>
} />
<Route
path='/'
element={
<Protected>
{role !== 'admin' ? (
<Navigate to='/project' />
) : (
<Navigate to='/clients' />
)}
</Protected>
}
/>
<Route
path='/project'
element={
+3
View File
@@ -0,0 +1,3 @@
{
"rewrites": [{ "source": "/(.*)", "destination": "/" }]
}