簡體   English   中英

如何在服務器根目錄下設置Foxx App?

[英]How to set Foxx App at server root?

我想知道如何在服務器/ IP /域名的根目錄下設置Foxx應用程序?

例如,如果我的IP是100.12.32.12如果我轉到http://100.12.32.12它將打開沒有URL重定向的單頁foxx應用程序。

我試過的事情

  1. 目前我讓Arangodb使用tcp://0.0.0.0:80端點,所以我得到了端口工作。

  2. 我還在我的應用程序的manifest.json設置了一個index.html文件,並將該應用程序掛載到/

    但是目前轉到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來顯示沒有重定向的應用程序。

  3. 我已經嘗試了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" 
}

重新啟動服務器(它需要重新加載現在的路由)。 清除/重新啟動瀏覽器(對於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>

如果看不到正確的地址,請檢查文檔是否在_routing中正確創建。

現在查看瀏覽器。 如果仍顯示錯誤的重定向,請刷新瀏覽器緩存。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM