如何删除#!来自卑鄙js申请的网址?

时间:2021-07-05 01:09:11

In mean js deep linking is enabled on default.how to remove #! in url of the mean js application ? i have tried using removing the following line in public/application.js.

在平均值js中,在default.how上启用深度链接以删除#!在js申请的url中?我试过在public / application.js中删除以下行。

$locationProvider.hashPrefix('!');

and adding the following line to public/application.js.

并将以下行添加到public / application.js。

$locationProvider.html5Mode(true);

but when I type the url http://localhost:3000/articles to access the article list view it shows the endpoint with articles json object array.

但是当我输入url http:// localhost:3000 / articles来访问文章列表视图时,它会显示带有文章json对象数组的端点。

1 个解决方案

#1


2  

anyway I found the answer for my question. add

无论如何,我找到了我的问题的答案。加

$locationProvider.html5Mode(true);

to the config/application.js.and add

到config / application.js.并添加

 <base href="/">

to app/views/layout.server.view.html.

and add

var core = require('../app/controllers/core.server.controller');
app.get('/*', core.index);

to the express.js file.

到express.js文件。

#1


2  

anyway I found the answer for my question. add

无论如何,我找到了我的问题的答案。加

$locationProvider.html5Mode(true);

to the config/application.js.and add

到config / application.js.并添加

 <base href="/">

to app/views/layout.server.view.html.

and add

var core = require('../app/controllers/core.server.controller');
app.get('/*', core.index);

to the express.js file.

到express.js文件。