diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..2ba986f --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,15 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "Launch Chrome against localhost", + "url": "http://localhost:8080", + "webRoot": "${workspaceFolder}" + } + ] +} \ No newline at end of file diff --git a/pages/index/contact.vue b/pages/index/contact.vue index 4f95978..090733a 100644 --- a/pages/index/contact.vue +++ b/pages/index/contact.vue @@ -34,7 +34,4 @@ useSeoMeta({ title: 'Contact me', description: 'Find my contact information', }) - -const index = useIndexStore() -console.log(index.colorMode.value) diff --git a/server/api/user/githubUserInfo.get.ts b/server/api/user/githubUserInfo.get.ts index 38ed697..65564c0 100644 --- a/server/api/user/githubUserInfo.get.ts +++ b/server/api/user/githubUserInfo.get.ts @@ -2,37 +2,32 @@ import { Octokit } from 'octokit' import { githubToken } from '~/server/utils/githubInfo' export default defineEventHandler(async (event) => { - try { - const getGithubUserInfo = async () => { - const octokit = new Octokit({ - auth: githubToken, - }) + const getGithubUserInfo = async () => { + const octokit = new Octokit({ + auth: githubToken, + }) - const data = await octokit.request('GET /user', { - headers: { - 'X-GitHub-Api-Version': '2022-11-28', - }, - }) - return data - } + const data = await octokit.request('GET /user', { + headers: { + 'X-GitHub-Api-Version': '2022-11-28', + }, + }) + return data + } - const githubUserInfo = await getGithubUserInfo() + const githubUserInfo = await getGithubUserInfo() - if (githubUserInfo.status === 200) { - setResponseStatus(event, 200) - return { - status: true, - data: githubUserInfo, - } - } else - return { - status: false, - data: { - message: 'Github api encountered problem', - }, - } - } catch (error) { - console.log('Error in githubUserInfo module') - console.log(error) - } + if (githubUserInfo.status === 200) { + setResponseStatus(event, 200) + return { + status: true, + data: githubUserInfo, + } + } else + return { + status: false, + data: { + message: 'Github api encountered problem', + }, + } })