Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Codea Web Server (Also on WebRepo)

2»

Comments

  • Posts: 1,364

    could the problem be that short timeout?

  • Posts: 1,828

    That fix worked for me too.

  • Posts: 421
    @RonJeffries If you have 'Working Copy' you can also view them there.

    @dave1707 I'm glad that helped! Let me know if this helps you too @UberGoober :smile:

    The .codea files are just plain old folders (not zip files) but iOS treats any folder with an extension like a file (sometimes unhelpfully).

    On Mac it at least has an option to 'View Contents' of these bundle folders... iOS could do with it too.
  • Posts: 1,828
    @Steppers hi noted just above your previous message that the fix worked for me too, but I am repeating that now in case it got lost in the shuffle.

    The web server works now, and the debugger works now too.I’m not super clear on what’s happening here, I have to admit, but I agree it looks promising.
  • Posts: 1,364

    debugger? there's a debugger in there? how do I invoke that? thanks!

  • Posts: 1,828

    …maybe I’m missing something, but the title of the post includes “debug server”, at least presently. Am I misunderstanding the meaning of that?

  • Posts: 421
    @UberGoober @RonJeffries There's another project on WebRepo, 'Debug Server'.

    It only really provides the same functionality as the parameter.watch stuff at the moment but it's a start.

    Note: You'll probably have to use that loop fix again for it.

    And on a related note, I've got a lot of advanced stuff in the works now. Server side scripting akin to PHP, Multiple Client handling & websockets so I expect things to get pretty spicy soon :smile:
  • Posts: 1,828

    I made a slightly more interactive version of the Debugger.

    It tracks taps and increments a “tap” variable every time a touch ends.

    Also, @Steppers: I gave it a generic icon that I sometimes use for my own utilities; maybe it could be a standard icon for library-type projects? (image attached too)

  • Posts: 421

    A sneak peak, code needs a little tidying up but WebSockets are working!

    teaser

    @UberGoober Nice, I actually have a few already included in the WebRepo project that are just unicode/emoji and rendered out (also attached).

  • Posts: 1,828
    Nice, are you planning on automatically putting them on library projects without icons?

    It seems to me that games and apps don’t need a default icon because icons made from screenshots are better, but library projects often have nothing to show visually and it would be handy to have a default icon for them.
  • Posts: 421
    @UberGoober Yes, I expect so. I think I'd like to enforce user icons for app & game projects but libraries often don't have anything worth using as an icon.
  • edited November 2021 Posts: 421

    I’ve made various improvements in this version.

    • The API is now far easier to use.
    • WebSockets are now supported
    • Server-side Lua embedded in HTML files are also supported
    • Various improvements to overall functionality.

    Basic usage to serve a static site from a folder in Codea’s documents folder is:

    function setup()
        WebServer(asset.documents.my_site)
    end
    

    This serves all content in the my_site folder at port 80 (default for browsers).

    WebServer.zip contains the slimmed-down Library project that provides full documentation when connected to from a browser!

    WebServerDemo.zip contains a more comprehensive example of the supported features (as well as the documentation).

    Also available on WebRepo!

  • edited November 2021 Posts: 421

    Documentation is available here

Sign In or Register to comment.