add test connection route

This commit is contained in:
xfarrow 2024-03-24 19:44:13 +01:00
parent af0811567c
commit 7d21f4c8ad
2 changed files with 27 additions and 1 deletions

View File

@ -25,6 +25,7 @@ const organizationRoutes = require('./routes/organization_routes.js');
const organizationAdminRoutes = require('./routes/organization_admin_routes.js'); const organizationAdminRoutes = require('./routes/organization_admin_routes.js');
const organizationPostRoutes = require('./routes/organization_post_routes.js'); const organizationPostRoutes = require('./routes/organization_post_routes.js');
const jobOffersRoutes = require('./routes/job_offer_routes.js'); const jobOffersRoutes = require('./routes/job_offer_routes.js');
const serverRoutes = require('./routes/server_routes.js');
/* /*
===== END IMPORTING MODULES ===== ===== END IMPORTING MODULES =====
@ -47,7 +48,7 @@ app.use(rateLimiter); // Apply the rate limiter middleware to all routes
/* /*
===== BEGIN ROUTE HANDLING ===== ===== BEGIN ROUTE HANDLING =====
*/ */
app.use('/api/server', serverRoutes.routes);
app.use('/api/persons', personRoutes.publicRoutes); app.use('/api/persons', personRoutes.publicRoutes);
app.use('/api/persons', personRoutes.protectedRoutes); app.use('/api/persons', personRoutes.protectedRoutes);
app.use('/api/organizations', organizationRoutes.routes); app.use('/api/organizations', organizationRoutes.routes);

View File

@ -0,0 +1,25 @@
/*
This code is part of Blink
licensed under GPLv3
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
*/
const express = require('express');
async function testConnection(req, res){
return res.status(200).send('The Blink API server is working');
}
const routes = express.Router(); // Routes not requiring token
routes.get('/test', testConnection);
module.exports = {
routes
}