Skip to content

Commit

Permalink
Merge pull request #178 from wittrockscode/nodeREADME
Browse files Browse the repository at this point in the history
add node-backend README
  • Loading branch information
wittrockscode authored Feb 10, 2024
2 parents 935be6c + fcb527e commit 4dfdbfb
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
39 changes: 39 additions & 0 deletions app/node-backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# node-backend

## Usage

### With Docker

1. Make sure Docker is installed on your system.
2. Navigate to the ``/WebMLOpenEO/app/node-backend`` in your terminal.
3. Run the following command to build the Docker image:
```bash
docker build -t node-backend .
4. Run the following command to run the application:
```bash
docker run -p 3000:3000 --name node-backend node-backend
### Without Docker
1. Make sure node.js is installed on your system.
2. Navigate to ``/WebMLOpenEO/app/node-backend`` in your terminal.
3. Run the following command to install all dependencies:
```bash
npm install
3. Run the following command to run the application:

```bash
npm start
## Testing
1. Make sure node.js is installed on your system.
2. Navigate to ``/WebMLOpenEO/app/node-backend`` in your terminal.
3. Run the following command to install all dependencies:
```bash
npm install
3. Run the following command to test the application:

```bash
npm test
> Attention! As this app is heavily dependent on the R-backend, 6 out of 14 tests will fail if the R-backend is not accessible. To start it, please refer to its README.
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,12 @@ function validate_CRS(feature_collection)
// Proj4-Definition for Web Mercator (EPSG:3857)
const webMercatorDef = proj4.defs('EPSG:3857');

// add more CRS and alias then proj4-default:
// add more CRS and alias then proj4-default:
// TODO: Any CRS or alias could simply be added here.
proj4.defs('urn:ogc:def:crs:EPSG:3857', proj4.defs('EPSG:3857'));
proj4.defs('urn:ogc:def:crs:EPSG:4326', proj4.defs('EPSG:4326'));
proj4.defs('urn:ogc:def:crs:OGC:1.3:CRS84', proj4.defs('EPSG:4326'));
proj4.defs('urn:ogc:def:crs:OGC::CRS84', proj4.defs('EPSG:4326'));

// lookup sourceCRS
const sourceCRS = proj4.defs(feature_collection.crs.properties.name);
Expand Down
3 changes: 2 additions & 1 deletion app/node-backend/validation_schemes/classify_schemas.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ const validCRS = [
'EPSG:102113',
'urn:ogc:def:crs:EPSG:3857',
'urn:ogc:def:crs:EPSG:4326',
'urn:ogc:def:crs:OGC:1.3:CRS84'
'urn:ogc:def:crs:OGC:1.3:CRS84',
'urn:ogc:def:crs:OGC::CRS84'
];

const CRS_SCHEMA = JOI.object(
Expand Down

0 comments on commit 4dfdbfb

Please sign in to comment.