Giter VIP home page Giter VIP logo

Comments (3)

Bosn avatar Bosn commented on June 18, 2024

这个最开始是这样的,可能是因为我对RAP的部署还不够了解,如果contextPath不是/,在部署到线上时,就会出现domain/RAP这样比较啰嗦的域名。亲有什么好的解决方案么?

即,可以支持context,又能在线上保持http://domain/可直接访问

from rap.

ufologist avatar ufologist commented on June 18, 2024

目前我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.

Bosn avatar Bosn commented on June 18, 2024

亲如果这方面有需求可以通过使用端口的方式。因为我们的主域是domain而domain/rap/... 这种重复对处女座的同学来说是一种折磨,再三考虑,我们使用ROOT一级。

from rap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.