I misunderstood the problem, but I see what the issue is now.
In your example above, you invoked @get at the top level of the module OxygenExample. The problem is that this is only executed during precompilation. It is not executed when loading the module via using OxygenExample.
To have it execute when loading the module, move the code into __init__:
module OxygenExample
using Oxygen
using HTTP
function __init__()
@get "/greet" function(req::HTTP.Request)
return "hello world!"
end
end
function runserver()
serve()
end
end # module OxygenExample