How to get rid of /site in Hippo CMS 13?

237 Views Asked by At

I'm trying to get rid of /site in Hippo CMS version 13

According to Hippo CMS version 12 documentation I can deploy my delivery application as ROOT.war (https://documentation.bloomreach.com/12/library/deployment/configuring/deploy-application-as-root_war.html)

However, that page is missing inside the documentation for version 13

I found that Hippo CMS version 13 does not support deployment as ROOT.war (https://documentation.bloomreach.com/library/deployment/system-architecture.html)

So, how do I get rid of /site? (Without changing nginx configurations)

Thanks

1

There are 1 best solutions below

0
Jose Daniel Vivar Personat On BEST ANSWER

I use a simple proxy server using Node.js, Express and http-proxy-middleware, I called it dev-server.js and to execute it you just run node dev-server.js:

const express = require('express')
const proxy = require('http-proxy-middleware')
const path = require('path')
const app = express()

const port = process.argv[2] || 9999
const cmsPort = 8080

// CMS webapp
app.use('/cms',
    proxy({
        target: `http://localhost:${cmsPort}`,
        changeOrigin: false
    })
)

// Website
app.use('/', 
    proxy({
        target: `http://localhost:${cmsPort}/site`,
        pathRewrite: {
            '^/site/': '/'
        },
        ws: true,
        changeOrigin: true
    })
)

app.listen(port)
console.log(`Listening on port ${port} ...`)

I don't recommend you to get rid of it, but circumvent it for your needs instead. Would this work for you?