# Using @TrameApp, how do I simply create an endpoint that returns a string?

**URL:** https://discourse.vtk.org/t/using-trameapp-how-do-i-simply-create-an-endpoint-that-returns-a-string/15763
**Category:** Development
**Tags:** trame, python
**Created:** [June 26, 2025, 1:07pm UTC](https://discourse.vtk.org/t/using-trameapp-how-do-i-simply-create-an-endpoint-that-returns-a-string/15763 "2025-06-26T13:07:49Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![uv382](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/u/c89c15/32.png) [@uv382](https://discourse.vtk.org/u/uv382)
#### Post date: [June 26, 2025, 1:07pm UTC](https://discourse.vtk.org/t/using-trameapp-how-do-i-simply-create-an-endpoint-that-returns-a-string/15763/1 "2025-06-26T13:07:49Z")

</div>

Let’s say I have this simple `@TrameApp`:

```python
@TrameApp()
class MyTrameApp:
    def __init__ (self, server: Server = None):
        self.server = get_server(server)

def main():
    app = MyTrameApp()
    app.server.start()

if __name__ == " __main__":
    main()

```

How would I add an endpoint that returns the string `Hello World` as type `text/plain`?

How would I add an endpoint that returns the string `console.log('Hello World');` as type `application/javascript`?

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [June 26, 2025, 1:15pm UTC](https://discourse.vtk.org/t/using-trameapp-how-do-i-simply-create-an-endpoint-that-returns-a-string/15763/2 "2025-06-26T13:15:46Z")

</div>

@Sebastien_Jourdain

---

<div class="post-metadata">

### Author: ![Sebastien\_Jourdain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sebastien_jourdain/32/100_2.png) [@Sebastien\_Jourdain](https://discourse.vtk.org/u/Sebastien_Jourdain)
#### Post date: [June 26, 2025, 7:12pm UTC](https://discourse.vtk.org/t/using-trameapp-how-do-i-simply-create-an-endpoint-that-returns-a-string/15763/3 "2025-06-26T19:12:37Z")

</div>

> <https://github.com/Kitware/trame/blob/master/examples/09_advanced/custom_endpoint/app.py>
