From 30bcee3998538cfbf0e7ea52155c0641a261235c Mon Sep 17 00:00:00 2001 From: martin-mfg <2026226+martin-mfg@users.noreply.github.com> Date: Wed, 8 Oct 2025 14:03:44 +0200 Subject: [PATCH] try almost all endpoints --- frontend/frontend/src/pages/Home/Home.js | 41 ++++++++++++++++-------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/frontend/frontend/src/pages/Home/Home.js b/frontend/frontend/src/pages/Home/Home.js index 960acf66..e0d4ff9d 100644 --- a/frontend/frontend/src/pages/Home/Home.js +++ b/frontend/frontend/src/pages/Home/Home.js @@ -133,19 +133,34 @@ const HomeScreen = () => { ); login(newUserId, userKey); try { - const req = createMockReq({ - method: 'GET', - url: '/api/status/pat-info', - }); - const res = createMockRes(); - try { - await router(req, res); - const body = res._getBody(); - const status = res._getStatusCode(); - console.log('mock results: ', { status, body }); - } catch (e) { - console.log('mock http error: ', e); - } + let testEndpoint = async (path) => { + const req = createMockReq({ + method: 'GET', + url: path, + }); + const res = createMockRes(); + try { + await router(req, res); + const body = res._getBody(); + const status = res._getStatusCode(); + console.log('mock results: ', { status, body }); + } catch (e) { + console.log('mock http error: ', e); + } + }; + const ghToken = prompt('input GitHub token:'); + process.env['PAT_1'] = ghToken; + await testEndpoint('/api/status/pat-info'); + await testEndpoint('/api/status/up'); + await testEndpoint('/api?username=martin-mfg'); + await testEndpoint('/api/gist?id=bbfce31e0217a3689c8d961a356cb10d'); + await testEndpoint( + '/api/pin/?username=martin-mfg&repo=openapi-generator', + ); + await testEndpoint( + '/api/top-langs/?username=anuraghazra&langs_count=4', + ); + // TODO: wakatime // console.log(router); /* const restResult = await axios.get(