Projects STRLCPY gradejs Commits bdbe237f
🤬
  • ■ ■ ■ ■ ■
    packages/public-api/src/app.ts
    skipped 4 lines
    5 5   
    6 6  export function createApp() {
    7 7   const app = express();
     8 + app.get('/', (_, res) => res.send('gradejs-public-api')); // healthcheck path
    8 9   app.use(cors);
    9 10   
    10 11   app.use(
    skipped 14 lines
  • ■ ■ ■ ■ ■ ■
    packages/public-api/src/router.test.ts
    skipped 19 lines
    20 20  const api = createSupertestApi(createApp);
    21 21   
    22 22  describe('routes / heathCheck', () => {
    23  - it('should return valid response', async () => {
    24  - await api.get('/healthcheck').set('Origin', 'http://localhost:3000').send().expect(200);
     23 + it('should return valid response for healthcheck path', async () => {
     24 + await api.get('/').send().expect(200);
    25 25   });
    26 26   
    27 27   it('should return not found error', async () => {
    skipped 215 lines
  • ■ ■ ■ ■ ■
    packages/public-api/src/router.ts
    skipped 35 lines
    36 36   
    37 37  export const appRouter = trpc
    38 38   .router<Context>()
    39  - .query('healthcheck', {
    40  - resolve() {
    41  - return 'gradejs-public-api';
    42  - },
    43  - })
    44 39   .mutation('syncWebsite', {
    45 40   input: z.string().regex(hostnameRe),
    46 41   async resolve({ input: hostname }) {
    skipped 40 lines
  • ■ ■ ■ ■ ■
    packages/web/src/services/apiClient.ts
    skipped 19 lines
    20 20   url: process.env.API_ORIGIN,
    21 21  });
    22 22   
    23  -export type HealthcheckOutput = InferQueryOutput<'healthcheck'>;
    24 23  export type SyncWebsiteOutput = InferMutationOutput<'syncWebsite'>;
    25 24  export type RequestParseWebsiteOutput = InferMutationOutput<'requestParseWebsite'>;
    26 25  export type { Api };
    skipped 2 lines
Please wait...
Page is in error, reload to recover