我想知道如何在服务器/ IP /域名的根目录下设置Foxx应用程序?
例如,如果我的IP是,100.12.32.12 如果我去http://100.12.32.12它将打开没有URL重定向的单页foxx应用程序.
我试过的事情
目前我让Arangodb使用tcp://0.0.0.0:80端点,所以我得到了端口工作.
我还在index.html我的应用程序中设置了一个文件manifest.json并将该应用程序安装到/
但是目前http://100.12.32.12 我将重定向到http://107.170.131.61/_db/_system/index.html哪个有效,但URL已更改.
也http://100.12.32.12/index.html有效,但我想知道是否可以http://100.12.32.12在没有重定向的情况下显示应用程序.
我尝试过,sudo arangod --javascript.app-path /path/to/app但似乎没有用.
谢谢.我是Arangodb和Foxx的新手.
你可以尝试以下方法吗?在终端窗口中打开 arangosh 或转到 GUI 中的 JS shell。
arangosh [_system]> db._routing.save({ url: "/", priority: 1, action: {do: "org/arangodb/actions/redirectRequest", options: {permanently: true, destination: "/index.html" } } })
{
"error" : false,
"_id" : "_routing/87048615",
"_rev" : "87048615",
"_key" : "87048615"
}
Run Code Online (Sandbox Code Playgroud)
重新启动服务器(需要重新加载现在的路由)。清除/重新启动浏览器(对于 Chrome,您可能需要忘记访问过的网站)。使用telnet检查
> telnet localhost 8529
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.1
HTTP/1.1 301 Moved
location: http://localhost:8529/index.html
server: ArangoDB
content-type: text/html
connection: Keep-Alive
content-length: 183
<html><head><title>Moved</title></head><body><h1>Moved</h1><p>This page has moved to <a href="http://localhost:8529/index.html">http://localhost:8529/index.html</a>.</p></body></html>
Run Code Online (Sandbox Code Playgroud)
如果您没有看到正确的地址,请检查文档是否在 _routing 中正确创建。
现在用浏览器检查。如果仍然显示错误的重定向,请刷新浏览器缓存。