Skip to content
Snippets Groups Projects
Commit f7b9e306 authored by esikkala's avatar esikkala
Browse files

Add WFS route

parent e5713779
No related branches found
No related tags found
No related merge requests found
......@@ -330,6 +330,12 @@ const fetchSimilarDocumentsEpic = (action$, state$) => action$.pipe(
})
)
// const fetchFHAWFSLayersEpic = (action$, state$) => action$.pipe(
// ofType(FETCH_FHA_WFS_LAYERS),
// withLatestFrom(state$)
// )
const rootEpic = combineEpics(
fetchPaginatedResultsEpic,
fetchResultsEpic,
......
......@@ -2,6 +2,7 @@ import express from 'express'
import path from 'path'
import bodyParser from 'body-parser'
import { has } from 'lodash'
import axios from 'axios'
import {
getResultCount,
getPaginatedResults,
......@@ -154,6 +155,22 @@ app.get(`${apiPath}/search`, async (req, res, next) => {
}
})
app.get(`${apiPath}/fha_wfs`, async (req, res, next) => {
const url = `
http://kartta.nba.fi/arcgis/services/WFS/MV_Kulttuuriymparisto/MapServer/WFSServer?request=GetFeature` +
`&service=WFS&version=2.0.0&typeName=${req.query.layer}&srsName=EPSG:4326&outputformat=geojson&bbox=${req.query.boxBounds}
`
try {
const response = await axios({
method: 'get',
url
})
res.send(response.data.features)
} catch (error) {
next(error)
}
})
// Express server is used to serve the React app only in production
if (!isDevelopment) {
/* Routes are matched to a url in order of their definition
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment