mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 09:24:36 +00:00
* Fixing issue #15302 -- lwip doesn't support signals * Adding test to catch issue #15302 -- lwip/freertos net library don't try to build / run on windows, it'll compile only but not run Fixing issue #15302 -- reworking test to compile on other platforms
31 lines
739 B
Nim
31 lines
739 B
Nim
discard """
|
|
targets: "c"
|
|
cmd: "nim $target --os:freertos --gc:arc $options $file"
|
|
disabled: "bsd"
|
|
disabled: "windows"
|
|
action: compile
|
|
"""
|
|
|
|
# Note:
|
|
# This file tests FreeRTOS/LwIP cross-compilation on UNIX platforms
|
|
# Windows should run when compiled with esp-idf, however I'm not
|
|
# sure how to test for only compilation on Windows without running
|
|
# a test exe
|
|
#
|
|
# Note:
|
|
# disabling *BSDs since they're not playing well with `gcc`
|
|
|
|
import net
|
|
import asynchttpserver, asyncdispatch
|
|
|
|
proc cb*(req: Request) {.async.} =
|
|
await req.respond(Http200, "Hello World")
|
|
|
|
proc run_http_server*() {.exportc.} =
|
|
echo "starting http server"
|
|
var server = newAsyncHttpServer()
|
|
|
|
waitFor server.serve(Port(8181), cb)
|
|
|
|
echo("ok")
|