Skip to content

Commit

Permalink
feat: new route
Browse files Browse the repository at this point in the history
new route
  • Loading branch information
JoaoGuedes01 committed Oct 19, 2023
1 parent 361694f commit 9a5bf9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-test-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ jobs:
steps:
- name: Build Docker Image
run: docker build -t preprocessing-webservice:ci .

- name: Run Docker Compose Up
run: docker-compose up -d
11 changes: 8 additions & 3 deletions src/controllers/api-controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const preprocessor = require('../utils/model-preprocessor')

const PreprocessRequest = async (req,res) =>{
const PreprocessRequest = async (req, res) => {
const model = req.params.model
const pred_obj = req.body.pred_obj

Expand All @@ -14,13 +14,18 @@ const PreprocessRequest = async (req,res) =>{
})
}

const GetAllPreprocessors = (req,res) => {
const GetAllPreprocessors = (req, res) => {
//Test comment
const all_preprocessors = ['hospitalization_pred']
return res.send(all_preprocessors)
}

const NewRoute = (req, res) => {
return res.send('This is a new route')
}

module.exports = {
PreprocessRequest: PreprocessRequest,
GetAllPreprocessors: GetAllPreprocessors
GetAllPreprocessors: GetAllPreprocessors,
NewRoute: NewRoute
}
1 change: 1 addition & 0 deletions src/routes/api-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const express = require('express');
const router = express.Router();
const apiController = require('../controllers/api-controller')

router.get('/new-route', apiController.NewRoute)
router.get('/preprocessors', apiController.GetAllPreprocessors)
router.post('/preprocess/:model', apiController.PreprocessRequest)
module.exports = router;

0 comments on commit 9a5bf9b

Please sign in to comment.