Created
November 12, 2019 11:11
-
-
Save 0xIslamTaha/a4a9f51ac9e6d1db064a1f59a2af6517 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Jumpscale import j | |
server = j.servers.openresty.get("test") | |
server.install(reset=True) | |
server.configure() | |
website = server.websites.get("test") | |
website.ssl = False | |
locations = website.locations.get("main") | |
website_location = locations.locations_static.new() | |
website_location.name = "home" | |
website_location.path_url = "/website" | |
website_location.path_location = "/sandbox/code/github/threefoldtech/jumpscaleX_core/JumpscaleCore/servers/openresty/examples/website/" | |
lapis_location = locations.locations_lapis.new() | |
lapis_location.name = "apps" | |
lapis_location.path_url = "/" | |
lapis_location.path_location = "/sandbox/code/github/threefoldtech/jumpscaleX_core/JumpscaleCore/servers/openresty/examples/lapis" | |
static_location = locations.locations_static.new() | |
static_location.name = "static" | |
static_location.path_url = "/static" | |
static_location.path_location = "/sandbox/code/github/threefoldtech/jumpscaleX_core/JumpscaleCore/servers/openresty/web_resources/static" | |
static_location.use_jumpscale_weblibs = True | |
locations.configure() | |
website.configure() | |
server.start() | |
lapis_content = j.clients.http.get("http://0.0.0.0/") | |
assert ( | |
lapis_content | |
== '<!DOCTYPE HTML><html lang="en"><head><title>Lapis Page</title></head><body>Hello from lapis!</body></html>' | |
) | |
static_content = j.clients.http.get("http://0.0.0.0/website/") | |
import ipdb; ipdb.set_trace() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment