From d8e45d0fd243e76275277534221d5c5784bd876c Mon Sep 17 00:00:00 2001 From: Renan Roseno Date: Sat, 6 Sep 2025 10:51:06 -0300 Subject: [PATCH] Feat/presentation (#24) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: conflicting branches * feat: add test error * feat: add lint error * feat: add error build * feat: add integration pipeline * ✨ feat: presentation endpoint * fix: npm run build --------- Co-authored-by: Victor Neves <43397591+v-venes@users.noreply.github.com> --- .github/workflows/ci.yml | 46 +++++++++++++++++++------------------- src/routes/index.ts | 2 ++ src/routes/presentation.ts | 16 +++++++++++++ 3 files changed, 41 insertions(+), 23 deletions(-) create mode 100644 src/routes/presentation.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db8bf86..afbed9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,28 +76,28 @@ jobs: # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Adicionar essa na de PR de DEV para PROD - # integration: - # runs-on: ubuntu-latest - # - # steps: - # - name: πŸ“₯ Verificar branches conflitantes - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - # - # - name: πŸ”‘ Configurar credenciais do Git - # run: | - # git config user.name "github-actions[bot]" - # git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - # - name: πŸ” Testar merge main <- develop - # run: | - # git fetch origin - # git checkout main - # git merge --no-commit --no-ff origin/develop || ( - # echo "❌ Conflitos detectados entre main e develop" && exit 1 - # ) - # git merge --abort || true - # echo "βœ… Nenhum conflito entre main e develop" + integration: + runs-on: ubuntu-latest + + steps: + - name: πŸ“₯ Verificar branches conflitantes + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: πŸ”‘ Configurar credenciais do Git + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: πŸ” Testar merge main <- develop + run: | + git fetch origin + git checkout main + git merge --no-commit --no-ff origin/develop || ( + echo "❌ Conflitos detectados entre main e develop" && exit 1 + ) + git merge --abort || true + echo "βœ… Nenhum conflito entre main e develop" check: runs-on: ubuntu-latest @@ -153,4 +153,4 @@ jobs: run: npm install - name: πŸš€ Build do projeto - run: npm run build + run: npm run build \ No newline at end of file diff --git a/src/routes/index.ts b/src/routes/index.ts index a48ffde..b34cec3 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -6,6 +6,7 @@ import { tablesSessionsRoutes } from './tables-sessions-routes'; import { ordersRoutes } from './orders-routes'; import { metricsRoutes } from './metrics'; import { healthRoutes } from './health'; +import { presentationRoutes } from './presentation'; const routes = Router(); routes.use('/products', productsRoutes); @@ -14,5 +15,6 @@ routes.use('/tables-sessions', tablesSessionsRoutes); routes.use('/orders', ordersRoutes); routes.use('/metrics', metricsRoutes); routes.use('/health', healthRoutes); +routes.use('/presentation', presentationRoutes); export { routes }; diff --git a/src/routes/presentation.ts b/src/routes/presentation.ts new file mode 100644 index 0000000..d117d62 --- /dev/null +++ b/src/routes/presentation.ts @@ -0,0 +1,16 @@ +import { Router, Request, Response } from 'express'; + +const presentationRoutes = Router(); + +presentationRoutes.get('/', async (_: Request, res: Response) => { + try { + res.json({ + message: '✨ Novo endpoint, olΓ‘ apresentaΓ§Γ£o!', + timeStamp: new Date().toISOString(), + }); + } catch (error) { + res.status(500).send('Error generating metrics'); + } +}); + +export { presentationRoutes };