diff --git a/striker-ui-api/src/routes/init.ts b/striker-ui-api/src/routes/init.ts index e42e11ad..153d6130 100644 --- a/striker-ui-api/src/routes/init.ts +++ b/striker-ui-api/src/routes/init.ts @@ -8,11 +8,27 @@ import { getNetworkInterface } from '../lib/request_handlers/network-interface'; const router = express.Router(); -router.use(assertInit()); - router - .get('/network-interface', getNetworkInterface) - .post('/', configStriker) - .put('/set-map-network', setMapNetwork); + .get( + '/network-interface/:hostUUID?', + assertInit({ + fail: ({ path }, response) => response.redirect(`/api${path}`), + }), + getNetworkInterface, + ) + .post( + '/', + assertInit({ + fail: (request, response) => response.redirect(`/api/host`), + }), + configStriker, + ) + .put( + '/set-map-network', + assertInit({ + fail: ({ path }, response) => response.redirect(`/api/command${path}`), + }), + setMapNetwork, + ); export default router;