https://slingdata.io logo
Hi, I need to add the specific endpoint
# sling-help
m
Hi, I need to add the specific endpoint generated value, for example, the current date. As I know, there is no option to compute values inside YAML files, but maybe there is some Sling functionality for this case?
f
check out [dynamic endpoints](https://docs.slingdata.io/~/revisions/Rx4OAB9nPXgKZ2vAhZ9A/concepts/api-specs/dynamic-endpoints) Alhtough it would need to be simpler, think this (not tested):
Copy code
dynamic_endpoints:
  - iterate: '[ date_format(now(), "%Y-%m-%d") ]'
    into: "state.date"
    endpoint:
      name: "my_endpoint"
      request:
        url: "{state.base_url}/{state.date}"
well to be honest, you could just use regular, just put today's date into a state:
Copy code
endpoints:
  health_check:
    state:
      date: "{ date_format(now(), "%Y-%m-%d") }"
    request:
      url: "{state.base_url}/{ state.date }"
m
Great, thanks for the fast reply 🙏
What actually this syntax belongs to? its based on yaml? So in YAML I can also process\generate simple values?
I can see on vscode extension autofill for some functions, but I want to understand where is there documentaion for all thoose things. Thanks in advence