...
 
Commits (2)
......@@ -16,7 +16,7 @@ nvm install --lts
nvm use --lts
```
Install the development server and the Elm dependencies with:
Install the local development server and the Elm dependencies with:
```sh
npm install
......@@ -24,23 +24,17 @@ npm install
## Development
Run the development server with:
Run the local development server with...
```sh
npm start
```
Then open http://localhost:8000/
...then open http://localhost:8000/
### Use production infrastructure while developing
It's not easy to install a complete DBnomics platform, so you can use the production infrastructure while developing on DBnomics UI.
To change the web API URL, edit `src/config/development.js`:
```
apiBaseUrl: "https://api.db.nomics.world/" OR "http://localhost:5000"
```
To change the web API URL, edit `src/config/local.js` and change `apiBaseUrl` config property.
It's also possible to use a local web API using the remote Solr index and reading remote Git repositories. To follow this path, please read the [web API README](https://git.nomics.world/dbnomics/dbnomics-api).
......@@ -61,10 +55,10 @@ Successfully generated /tmp/app.js
## Deploy
Deploy in integration enviroment:
Deploy in pre-production enviroment:
```sh
TARGET_ENV=integration npm run build && scp -r dist/* dbnomics@hebe.nomics.world:dbnomics-ui-static
TARGET_ENV=pre npm run build && scp -r dist/* dbnomics@ioke.nomics.world:dbnomics-ui-static
```
Deploy in production enviroment:
......
// Development server config
var prodConfig = require("./production.js")
module.exports = Object.assign(prodConfig, {
apiBaseUrl: 'https://api.dev.nomics.world/v21',
apiBaseUrl: 'https://api.dev.nomics.world/v22',
})
// Local development server
var prodConfig = require("./production.js")
module.exports = Object.assign(prodConfig, {
......
// Pre-production server config
var prodConfig = require("./production.js")
module.exports = Object.assign(prodConfig, {
apiBaseUrl: 'http://api.pre.nomics.world/v21',
})
// Production server config
module.exports = {
apiBaseUrl: 'https://api.db.nomics.world/v21',
apiVersionRequirements: { greaterThanOrEqualTo: '0.21.6', lessThan: '0.22.0' },
......
......@@ -191,7 +191,7 @@ viewFeatures =
[ text "An open platform" ]
, p []
[ text "One website aggregating global data and "
, a [ href "https://api.db.nomics.world/apidocs" ]
, a [ href "https://api.db.nomics.world/v21/apidocs" ]
[ text "one API" ]
, text """. Data series delivered in various formats (CSV, Excel XLSX, JSON).
Direct access from your statistical software ("""
......
......@@ -177,7 +177,7 @@ footer =
, li []
[ a
[ target "_blank"
, href "https://api.db.nomics.world/apidocs"
, href "https://api.db.nomics.world/v21/apidocs"
]
[ text "Web API" ]
]
......
......@@ -8,7 +8,7 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin')
var CopyWebpackPlugin = require('copy-webpack-plugin')
// determine build env
const TARGET_ENV = process.env.TARGET_ENV || (process.env.npm_lifecycle_event === 'build' ? "production" : "development")
const TARGET_ENV = process.env.TARGET_ENV || (process.env.npm_lifecycle_event === 'build' ? "production" : "local")
// entry and output path/filename variables
const entryPath = path.join(__dirname, 'src/static/index.js')
......@@ -68,7 +68,7 @@ var commonConfig = {
}
// additional webpack settings for local env (when invoked by 'npm start')
if (TARGET_ENV === "development") {
if (TARGET_ENV === "local") {
module.exports = merge(commonConfig, {
entry: [
'webpack-dev-server/client?http://localhost:8000',
......@@ -118,7 +118,7 @@ if (TARGET_ENV === "development") {
}
// additional webpack settings for prod env (when invoked via 'npm run build')
if (TARGET_ENV === "integration" || TARGET_ENV === "production") {
if (TARGET_ENV === "dev" || TARGET_ENV === "pre" || TARGET_ENV === "production") {
module.exports = merge(commonConfig, {
entry: [
// Install polyfills. Needed for IE compatibility.
......