fix(striker-ui-api): match method, path pattern for config striker

main
Tsu-ba-me 2 years ago
parent cefbba36ca
commit 50a1160f1d
  1. 2
      striker-ui-api/src/routes/host.ts
  2. 10
      striker-ui-api/src/routes/init.ts

@ -22,7 +22,7 @@ router
.post('/', createHost) .post('/', createHost)
.post(CONNECTION_PATH, createHostConnection) .post(CONNECTION_PATH, createHostConnection)
.put('/prepare', prepareHost) .put('/prepare', prepareHost)
.put('/:hostUUID', updateHost) .put('/:hostUUID?', updateHost)
.delete(CONNECTION_PATH, deleteHostConnection); .delete(CONNECTION_PATH, deleteHostConnection);
export default router; export default router;

@ -12,21 +12,23 @@ router
.get( .get(
'/network-interface/:hostUUID?', '/network-interface/:hostUUID?',
assertInit({ assertInit({
fail: ({ path }, response) => response.redirect(`/api${path}`), fail: ({ path }, response) => response.redirect(307, `/api${path}`),
}), }),
getNetworkInterface, getNetworkInterface,
) )
.post( .put(
'/', '/',
assertInit({ assertInit({
fail: (request, response) => response.redirect(`/api/host`), fail: (request, response) =>
response.redirect(307, `/api/host?handler=striker`),
}), }),
configStriker, configStriker,
) )
.put( .put(
'/set-map-network', '/set-map-network',
assertInit({ assertInit({
fail: ({ path }, response) => response.redirect(`/api/command${path}`), fail: ({ path }, response) =>
response.redirect(307, `/api/command${path}`),
}), }),
setMapNetwork, setMapNetwork,
); );

Loading…
Cancel
Save