Skip to content

Commit

Permalink
sparql not open
Browse files Browse the repository at this point in the history
  • Loading branch information
nbittich committed May 7, 2022
1 parent ef4964a commit 25c33bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 4 additions & 1 deletion api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import fetch from "node-fetch";
import { Parser } from "sparqljs";
const BACKEND_URL = process.env.BACKEND_URL || "http://localhost:9000";

const SPARQL_DEFAULT_URL =
process.env.SPARQL_DEFAULT_URL || "http://localhost:8888/public/sparql";

export async function getPublicInformation() {
const response = await fetch(`${BACKEND_URL}/api/cv`);
return await response.json();
Expand Down Expand Up @@ -70,7 +73,7 @@ export async function postContactForm(formData) {
}

export async function postSparqlQuery(formData) {
const url = formData.sparqlEndpoint;
const url = SPARQL_DEFAULT_URL;
const query = formData.sparqlQuery;
let sparqlResultType = "application/sparql-results+json";
let accept = sparqlResultType;
Expand Down
4 changes: 0 additions & 4 deletions index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ import {
} from "./api.mjs";

const SERVER_PORT = process.env.SERVER_PORT || 4000;
const SPARQL_DEFAULT_URL =
process.env.SPARQL_DEFAULT_URL || "http://localhost:8888/public/sparql";
const SPARQL_DEFAULT_QUERY =
process.env.SPARQL_DEFAULT_QUERY ||
`
Expand Down Expand Up @@ -96,7 +94,6 @@ router.get(
res.render("sparql.html", {
pageTitle: WEBSITE_TITLE,
activePage: "sparql-form",
defaultEndpoint: SPARQL_DEFAULT_URL,
defaultQuery: SPARQL_DEFAULT_QUERY,
defaultAcceptType: "application/trig",
});
Expand All @@ -111,7 +108,6 @@ router.post(
pageTitle: WEBSITE_TITLE,
result,
activePage: "sparql-form",
defaultEndpoint: req.body.sparqlEndpoint,
defaultQuery: req.body.sparqlQuery,
defaultAcceptType: req.body.acceptType,
});
Expand Down

0 comments on commit 25c33bb

Please sign in to comment.