2015-07-11 42 views
2

我想使用URL http://localhost:3000/theapp而不是http://localhost:3000/访问整个应用程序。Meteor.js:是否可以更改URL中的基本路径?

在应用程序中的HTML源代码构建使用meteor build

<html> 
<head> 
    <link rel="stylesheet" type="text/css" class="__meteor-css__" href="/8b140b84a4d3a2c1d8f5ea63435df8afc22985aa.css?meteor_css_resource=true"> 
    <script src="/215e9bb1458d81c946c277ecc778bae4fc8eb569.js"> 
... 

我想从/基本路径更改为/theapp,因此上述<link><script>标签将成为:

<link rel="stylesheet" type="text/css" class="__meteor-css__" href="/theapp/8b140b84a4d3a2c1d8f5ea63435df8afc22985aa.css?meteor_css_resource=true"> 
    <script src="/theapp/215e9bb1458d81c946c277ecc778bae4fc8eb569.js"> 

这个要求的原因是我试图使用Nginx根据URL中的路径将请求转发到不同的流星应用程序:

http://localhost/app1 ==> http://meteor-app1 
http://localhost/app2 ==> http://meteor-app2 

这可能吗?

因此,@ d4nyll在评论中提到,我需要做服务器级路由而不是应用级路由。诸如Iron Router/Flow Router之类的解决方案将不起作用。

回答

相关问题