# Rest server – How to

**URL:** <https://forum.xojo.com/t/rest-server-how-to/79620>\
**Category:** Web\
**Created:** [March 17, 2024, 10:50pm UTC](https://forum.xojo.com/t/rest-server-how-to/79620 "2024-03-17T22:50:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergio\_Molino](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/ac91a4/32.png) [@Sergio\_Molino](https://forum.xojo.com/u/Sergio_Molino)\
**Post date:** [March 17, 2024, 10:50pm UTC](https://forum.xojo.com/t/rest-server-how-to/79620/1 "2024-03-17T22:50:23Z")

</div>

I try to understand how build a Rest server with Xojo, I have very little experience with REST server.  
So I am looking for some example on how to do.

I found two framework:

- Express from: [GitHub - sworteu/Express: Express is a Xojo API 2.0 compilant speed optimized webserver that is orignally based on AloeExpress by Tim Dietrich.](https://github.com/sworteu/Express)  
Let this framework build a REST server? where may find some example?

- LunaAPI2 from: [GitHub - Valdemar-VDSC/Luna-API2: LUNA for XOJO API2](https://github.com/Valdemar-VDSC/Luna-API2)  
I understood that this framework let build a webREST app, but is more targhet to DB backend, there is some documentation about this one?  
My application is not a DB server application.

Any help or suggestion is welcome.  
Thanks

---

<div class="post-metadata">

**Author:** ![Patrick\_Salo](https://forum.xojo.com/user_avatar/forum.xojo.com/patrick_salo/32/514_2.png) [@Patrick\_Salo](https://forum.xojo.com/u/Patrick_Salo)\
**Post date:** [March 17, 2024, 11:41pm UTC](https://forum.xojo.com/t/rest-server-how-to/79620/2 "2024-03-17T23:41:31Z")

</div>

Here’s [another one for you from Greg O’Lone that you missed.](https://forum.xojo.com/t/handleurl-session-specific/60532/13)

---

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [March 18, 2024, 1:25am UTC](https://forum.xojo.com/t/rest-server-how-to/79620/3 "2024-03-18T01:25:56Z")

</div>

Here’s a simple one for you. Place this code in the HandleURL event handler in the App class.

```auto
Var j As New JSONItem
j.Value("Address") = request.RemoteAddress
response.Status = 200
response.Header("content-type") = "application/json"
response.Write(j.ToString)
Return True

```

This code simply returns the ip address of the machine making the request to the web application or the ip address of the router if called remotely.

---

<div class="post-metadata">

**Author:** ![Sergio\_Molino](https://forum.xojo.com/letter_avatar_proxy/v4/letter/s/ac91a4/32.png) [@Sergio\_Molino](https://forum.xojo.com/u/Sergio_Molino)\
**Post date:** [March 18, 2024, 9:08am UTC](https://forum.xojo.com/t/rest-server-how-to/79620/4 "2024-03-18T09:08:27Z")

</div>

Thank you Patrick and Wayne, I will check and try 😉

---

<div class="post-metadata">

**Author:** ![Daniel\_Mullins](https://forum.xojo.com/user_avatar/forum.xojo.com/daniel_mullins/32/15747_2.png) [@Daniel\_Mullins](https://forum.xojo.com/u/Daniel_Mullins)\
**Post date:** [March 19, 2024, 12:13pm UTC](https://forum.xojo.com/t/rest-server-how-to/79620/5 "2024-03-19T12:13:48Z")

</div>

Depending on what the web app is doing, I have found that you cannot do big processes here (HandleURL). If you need to process data to send back to a client, have the client connect and request, and have it poll to get the info when the server has it ready, and ready to send without a whole lot of processing (i.e. just grabbing it from a variable and passing it on).
