Programming an easy Webserver

  1. 2 years ago

    Hello I am an apprentice and got the task to program a webserver which outputs a "hello world" in http: localhost: arbitrary_port. As a beginner I don't know much about it and therefore I ask for an approach. :D

    THX for Help

    Also take a look at the simple web server example project included with Xojo:

    Examples/Communication/Internet/Web Server

  2. Derk J

    16 Jan 2018 Pre-Release Testers, Xojo Pro

    You can look in the examples folder, under internet ithought there was an example webserver project

  3. What i find was an error page. ^^" No examples.

  4. Alberto D

    16 Jan 2018 Pre-Release Testers, Xojo Pro

    From Xojo: File - New Project - Click Examples icon on the left side of the 'Choose a Project' windows - then scroll down to Web.

    Maybe the DialogsExample.xojo_binary_project will help

  5. Alexander v

    16 Jan 2018 Europe (Houten, The Netherland...

    Take a look at this GitHub repository. A full fledged webserver.

  6. Markus W

    16 Jan 2018 #JeSuisHuman New Zealand, Auc...

    School project?

  7. It's a project from my Company to improve my programming

  8. Markus W

    16 Jan 2018 #JeSuisHuman New Zealand, Auc...

    In that case go with the GitHub one, work through the source code, and make some flow charts how it all connects.

  9. Hal G

    16 Jan 2018 Pre-Release Testers, Xojo Pro, XDC Speakers CampSoftware.com

    @Patrick Lmmer Hello I am an apprentice and got the task to program a webserver which outputs a "hello world" in http: localhost: arbitrary_port. As a beginner I don't know much about it and therefore I ask for an approach. :D

    THX for Help

    Check out AloeExpress. It's open source: https://aloe.zone/ The demo does exactly that! :)

    Xanadu uses the prior version of Aloe: https://campsoftware.com/products/xanadu-for-xojo.php We plan to update Xanadu to use AloeExpress before the Xojo Developer Conference. :)

  10. I just need a "Hello World" to localhost plus any port i want to see it in the browser ^^"

  11. Tim P

    18 Jan 2018 Pre-Release Testers Rochester, NY

    @Patrick Lmmer I just need a "Hello World" to localhost plus any port i want to see it in the browser ^^"

    On Mac that's as easy as turning on Apache

  12. Jason P

    18 Jan 2018 Xojo Inc Texas

    Some names have changed but this might help:

    http://www.macdevcenter.com/pub/a/mac/2004/11/19/realbasic.html

  13. My task is writing a program in Xojo to do that @Tim P :)

  14. @Jason P Some names have changed but this might help:

    http://www.macdevcenter.com/pub/a/mac/2004/11/19/realbasic.html

    This looks interesting maybe i can some things adapt

  15. Paul L

    18 Jan 2018 Xojo Inc, Third Party Store Answer
    Edited 2 years ago

    Also take a look at the simple web server example project included with Xojo:

    Examples/Communication/Internet/Web Server

  16. @Hal G Why is xojo.core.dictionary used in the demo 1?

  17. Tim D

    22 Jan 2018 Pre-Release Testers, Xojo Pro, XDC Speakers

    Hi @Patrick Lmmer. I'm the developer of Aloe Express, and I'm happy to answer any questions about it.

    What xojo.core.dictionary are you referring to in demo 1?

  18. ehhhm new Question i used the Webserver example and need to get explained how this works

    i tried to figure it out in my language (german)

    Dim f As FolderItem
    Dim i As Integer //schleifen variable
    Dim Count As Integer
    Dim pathChunk As String

    // locate a file that we are hosting based off the path
    f = rootDir
    Count = CountFields(path, "/")

    For i = 2 To Count
    pathChunk = NthField(path, "/", i)
    If pathChunk = ".." Then // move up a level
    f = f.Parent
    End
    If pathChunk = "" And i = Count Then
    pathChunk = "index.html"
    End

    pathChunk = ConvertURLString(pathChunk)
    f = f.Child(pathChunk)
    If f = Nil Or f.Exists = False Then
    Return Nil
    End If
    Next

    Return f

  19. @Tim D in case that i am beginner and don't really understand that i used the Webserver Example from Xojo but thanks :)

  20. shao s

    23 Jan 2018 Pre-Release Testers Sudbury, Ontario, Canada

    Basically it's taking the URL passed and converting it to a local file path, based on the web root..

or Sign Up to reply!