Setting Routes

The route section is used to configure the access to your app.

Add routing config under express-server:

  1. servcies:
  2. express-server:
  3. ...
  4. route:
  5. domain: example.com
  6. rules:
  7. - path: /testapp
  8. rewriteTarget: /

The full specification of route could be found here

Apply again:

  1. $ vela up

Check the status until we see route is ready:

  1. $ vela status testapp
  2. About:
  3. Name: testapp
  4. Namespace: default
  5. Created at: 2020-11-04 16:34:43.762730145 -0800 PST
  6. Updated at: 2020-11-11 16:21:37.761158941 -0800 PST
  7. Services:
  8. - Name: express-server
  9. Type: webservice
  10. HEALTHY Ready: 1/1
  11. Last Deployment:
  12. Created at: 2020-11-11 16:21:37 -0800 PST
  13. Updated at: 2020-11-11T16:21:37-08:00
  14. Routes:
  15. - route: Visiting URL: http://example.com IP: <ingress-IP-address>

In kind cluster setup, you can visit the service via localhost:

If not in kind cluster, replace ‘localhost’ with ingress address

  1. $ curl -H "Host:example.com" http://localhost/testapp
  2. Hello World