Skip to content

Commit

Permalink
#8465 Imrpoving API and preventing issues from geostore (#8666)
Browse files Browse the repository at this point in the history
  • Loading branch information
offtherailz committed Oct 6, 2022
1 parent 5a7c7c5 commit 51bb0dc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
13 changes: 7 additions & 6 deletions build/devServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,41 @@ const protocol = process.env.MAPSTORE_BACKEND_PROTOCOL || "http";
const host = process.env.MAPSTORE_BACKEND_HOST || "localhost";
const MAPSTORE_BACKEND_BASE_URL = process.env.MAPSTORE_BACKEND_BASE_URL || (protocol + "://" + host + ":" + port);
const MAPSTORE_BACKEND_BASE_PATH = process.env.MAPSTORE_BACKEND_BASE_PATH || "/mapstore";
var matches = MAPSTORE_BACKEND_BASE_URL.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
const MAPSTORE_BACKEND_URL = process.env.MAPSTORE_BACKEND_URL || MAPSTORE_BACKEND_BASE_URL + MAPSTORE_BACKEND_BASE_PATH;
var matches = MAPSTORE_BACKEND_URL.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
var domain = matches && matches[1];
// configuration for local dev server. This is used by webpack-dev-server
// to proxy requests to the backend.
const devServer = {
proxy: {
'/rest': {
target: `${MAPSTORE_BACKEND_BASE_URL}${MAPSTORE_BACKEND_BASE_PATH}`,
target: MAPSTORE_BACKEND_URL,
secure: false,
logLevel: "debug"
},
'/pdf': {
target: `${MAPSTORE_BACKEND_BASE_URL}${MAPSTORE_BACKEND_BASE_PATH}`,
target: MAPSTORE_BACKEND_URL,
secure: false,
headers: {
host: domain
}
},
'/proxy': {
target: `${MAPSTORE_BACKEND_BASE_URL}${MAPSTORE_BACKEND_BASE_PATH}`,
target: MAPSTORE_BACKEND_URL,
secure: false,
headers: {
host: domain
}
},
'/extensions.json': {
target: `${MAPSTORE_BACKEND_BASE_URL}${MAPSTORE_BACKEND_BASE_PATH}`,
target: MAPSTORE_BACKEND_URL,
secure: false,
headers: {
host: domain
}
},
'/dist/extensions': {
target: `${MAPSTORE_BACKEND_BASE_URL}${MAPSTORE_BACKEND_BASE_PATH}`,
target: MAPSTORE_BACKEND_URL,
secure: false,
headers: {
host: domain
Expand Down
4 changes: 2 additions & 2 deletions docs/developer-guide/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ See the [dedicated section in this page](#backend) for more info
You can run only the front-end running `npm run fe:start`.
Running this script MapStore will run on port `8081` and will look for the back-end at port `8080`.

If you want to use an online instance of MapStore as backend, instead of the local one, you can define the environment variable `MAPSTORE_BACKEND_BASE_URL` to the desired URL.
If you want to use an online instance of MapStore as backend, instead of the local one, you can define the environment variable `MAPSTORE_BACKEND_URL` to the desired URL.

```sh
export MAPSTORE_BACKEND_BASE_URL=https://demo.geo-solutions.it/mapstore
export MAPSTORE_BACKEND_URL=https://dev-mapstore.geosolutionsgroup.com/mapstore
npm run fe:start # this command lunches only the front-end
```

Expand Down
4 changes: 4 additions & 0 deletions product/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@
<properties>
<cargo.servlet.port>${tomcat.port}</cargo.servlet.port>
<cargo.logging>low</cargo.logging>
<!-- setting javax.xml.parsers.SAXParserFactory is a workaround for issue https://github.com/geosolutions-it/geostore/issues/311 and can be removed when solved -->
<cargo.jvmargs>
-Djavax.xml.parsers.SAXParserFactory="com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"
</cargo.jvmargs>
</properties>
</configuration>
<deployables>
Expand Down

0 comments on commit 51bb0dc

Please sign in to comment.