Comments (3)
这个最开始是这样的,可能是因为我对RAP的部署还不够了解,如果contextPath不是/,在部署到线上时,就会出现domain/RAP这样比较啰嗦的域名。亲有什么好的解决方案么?
即,可以支持context,又能在线上保持http://domain/可直接访问
from rap.
目前我fork的版本中实现了既能够在ROOT部署, 又能够自定义contextpath.
主要是需要修改const.inc.vm获得contextpath
#set($projectContext = "$!request.getContextPath()")
#set($urlRoot = "$!request.getServerName():" + "$!request.getServerPort()" + "$!projectContext")
另外就是其他页面中通过utils.macro.vm的 includeRapStatic 统一引入静态资源
<script>
var RAP_ROOT_URL = location.protocol + '//' + '${urlRoot}';
</script>
这样其他JS就都能够获得正确的URL路径的, 例如routes.js中定义的action映射
'projects': RAP_ROOT_URL + '/org/projects.action'
当然了, 还有其他涉及到的细小地方需要做出调整, 不过确实是能够达到目的的
from rap.
亲如果这方面有需求可以通过使用端口的方式。因为我们的主域是domain而domain/rap/... 这种重复对处女座的同学来说是一种折磨,再三考虑,我们使用ROOT一级。
from rap.
Related Issues (20)
- json导入数据出错
- 视频打不开
- 账号登陆报错 HOT 1
- 建议: 添加邮件通知功能
- 页面样式不对,查看接口太烦
- 接口响应参数字段内容太长导致样式问题(出现水平滚动条) HOT 1
- 删除定义接口的属性报错
- rap2新版的登录不了,无法登录
- 无法登陆了
- 导入多层json 格式导出格式错误
- 急需要支持导出swagger.json格式的功能!!! HOT 3
- Rap does not support Emoji symbol preservation(rap不支持emoji符号保存)
- 写好的接口参数莫名其妙丢失
- 自己创建的项目,自己是超级管理员,但是自己都没有编辑权限,看不到编辑按钮,别人可以看到编辑按钮,但是点击编辑按钮的时候显示“该项目已被XX锁定”
- 图片加载失败
- 我用的版本是v0.14.16, 控制台右上角的请求根路径无法修改,并且只有"请求"按钮,没有"mockjs数据"和"mockjs模板"按钮
- 添加接口点击秒存
- docker部署的时候登陆报错 HOT 2
- 页面打不开
- war包现在不给下载了吗
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rap.