The command shows is two-part: first, it generates the manifest, then it applies the generated manifest. kubectl kustomize is a built-in integration with kustomize, similar to kustomize build.
kubectl kustomize /opt/course/5/api-gateway/staging | kubectl apply -f -
Alternatively, you can do: kubectl apply -k /opt/course/5/api-gateway/staging