1
我嘗試在c9.io發展 - 與結構複製的項目:的Node.js服務器返回HTML文件,而不是JSON響應
\-C9ProjectName
|
+---Frontend
| |
| \---index.html - AngularJS app
|
\---Backend
|
\---server.js - Node.js server
Server.js開始env.IP和env.PORT和使用以https表示。 的index.html獲得了$ http.get請求( 'https://C9ProjectName.c9.io/api/method '),但響應的html文件:
<title>Sign-in | Cloud9 IDE - Ajax.org</title>
<meta name="description" content="Meet Cloud9, development-as-a-service for Javascripters and other developers"/>
如果調用' https://C9ProjectName.c9.io/api/method' 直接 - 服務器發送響應正常的JSON答案。
什麼會導致從雲9歸還html文件?
你沒錯!有效。謝謝穆塔希爾! – Archarious
hahahaha。那是對的。我在過去的4個小時裏一直在尋找這個問題。我想我失去了一半的頭髮:) –