Skip to content

Commit

Permalink
prepared deploy (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
garciafdezpatricia authored Jun 8, 2024
1 parent e9de2ba commit 782a7d6
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 55 deletions.
4 changes: 2 additions & 2 deletions client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ pnpm dev
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
Open [https://garciafdezpatricia.github.io/TidyTime](https://garciafdezpatricia.github.io/TidyTime) with your browser to see the result.

You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.

[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [https://garciafdezpatricia.github.io/TidyTime/api/hello](https://garciafdezpatricia.github.io/TidyTime/api/hello). This endpoint can be edited in `pages/api/hello.ts`.

The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.

Expand Down
16 changes: 8 additions & 8 deletions client/pages/api/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function useGithubHandler() {

const serverCheck = async () => {
try {
const response = await fetch("http://localhost:8080/health-check", {method: 'GET'});
const response = await fetch("https://tidytime.onrender.com/health-check", {method: 'GET'});
if (response.ok) {
return true;
} else {
Expand All @@ -24,7 +24,7 @@ export function useGithubHandler() {
try {
const response = await serverCheck();
if (response) {
window.location.assign("http://localhost:8080/github/auth");
window.location.assign("https://tidytime.onrender.com/github/auth");
} else {
toast.error('Server appears to be down');
}
Expand All @@ -37,7 +37,7 @@ export function useGithubHandler() {
try {
const response = await serverCheck();
if (response) {
const userResponse = await fetch('http://localhost:8080/github/logout', {
const userResponse = await fetch('https://tidytime.onrender.com/github/logout', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Expand All @@ -61,7 +61,7 @@ export function useGithubHandler() {
try {
const response = await serverCheck();
if (response) {
const userResponse = await fetch('http://localhost:8080/github/user/data', {
const userResponse = await fetch('https://tidytime.onrender.com/github/user/data', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Expand All @@ -87,7 +87,7 @@ export function useGithubHandler() {
try {
const response = await serverCheck();
if (response) {
const issues = await fetch('http://localhost:8080/github/issues/get?user=' + user, {
const issues = await fetch('https://tidytime.onrender.com/github/issues/get?user=' + user, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Expand All @@ -108,7 +108,7 @@ export function useGithubHandler() {
try {
const response = await serverCheck();
if (response) {
const issues = await fetch('http://localhost:8080/github/issues/close', {
const issues = await fetch('https://tidytime.onrender.com/github/issues/close', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -137,7 +137,7 @@ export function useGithubHandler() {
try {
const response = await serverCheck();
if (response) {
const issues = await fetch('http://localhost:8080/github/issues/open', {
const issues = await fetch('https://tidytime.onrender.com/github/issues/open', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -166,7 +166,7 @@ export function useGithubHandler() {
try {
const response = await serverCheck();
if (response) {
const issues = await fetch('http://localhost:8080/github/issues/update', {
const issues = await fetch('https://tidytime.onrender.com/github/issues/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
16 changes: 8 additions & 8 deletions client/pages/api/google.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function useGoogleHandler() {
const { events, setEvents } = useEventContext();

const serverCheck = () => {
return fetch("http://localhost:8080/health-check", { method: 'GET' })
return fetch("https://tidytime.onrender.com/health-check", { method: 'GET' })
.then(response => {
if (response.ok) {
return true;
Expand All @@ -26,7 +26,7 @@ export function useGoogleHandler() {
serverCheck()
.then(response => {
if (response) {
fetch('http://localhost:8080/google/auth/logout', {
fetch('https://tidytime.onrender.com/google/auth/logout', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -66,7 +66,7 @@ export function useGoogleHandler() {
serverCheck()
.then(response => {
if (response) {
fetch('http://localhost:8080/google/auth/url', {
fetch('https://tidytime.onrender.com/google/auth/url', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -128,7 +128,7 @@ export function useGoogleHandler() {
.then(response => {
if (response) {
return new Promise<boolean>((resolve, reject) => {
fetch('http://localhost:8080/google/calendar/list', {
fetch('https://tidytime.onrender.com/google/calendar/list', {
method: 'GET',
credentials: 'include',
})
Expand Down Expand Up @@ -171,7 +171,7 @@ export function useGoogleHandler() {
.then(response => {
if (response) {
return new Promise<boolean>((resolve, reject) => {
fetch('http://localhost:8080/google/events/get', {
fetch('https://tidytime.onrender.com/google/events/get', {
method: 'POST',
credentials: 'include',
headers: { 'Content-Type': 'application/json'},
Expand Down Expand Up @@ -252,7 +252,7 @@ export function useGoogleHandler() {
// format date to google format
const ISOStartDate = new Date(new Date(eventToShare.start).getTime() - (new Date(eventToShare.start).getTimezoneOffset() * 60000)).toISOString();
const ISOEndDate = new Date(new Date(eventToShare.end).getTime() - (new Date(eventToShare.end).getTimezoneOffset() * 60000)).toISOString();
fetch('http://localhost:8080/google/events/insert', {
fetch('https://tidytime.onrender.com/google/events/insert', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -311,7 +311,7 @@ export function useGoogleHandler() {
// format date to google format
const ISOStartDate = new Date(new Date(eventToUpdate.start).getTime() - (new Date(eventToUpdate.start).getTimezoneOffset() * 60000)).toISOString();
const ISOEndDate = new Date(new Date(eventToUpdate.end).getTime() - (new Date(eventToUpdate.end).getTimezoneOffset() * 60000)).toISOString();
fetch('http://localhost:8080/google/events/update', {
fetch('https://tidytime.onrender.com/google/events/update', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down Expand Up @@ -352,7 +352,7 @@ export function useGoogleHandler() {

const isAuthenticatedUser = async (emailParam:string) => {
try {
const fetchResponse = await fetch('http://localhost:8080/google/auth/email', {
const fetchResponse = await fetch('https://tidytime.onrender.com/google/auth/email', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand Down
Loading

0 comments on commit 782a7d6

Please sign in to comment.