Skip to content

Commit

Permalink
Merge pull request #131 from oSoc18/develop
Browse files Browse the repository at this point in the history
Deploy V0.0.8
  • Loading branch information
LieselotGeirnaert authored Jul 19, 2018
2 parents e663bf6 + 5ae5b03 commit e27ccc9
Show file tree
Hide file tree
Showing 14 changed files with 503 additions and 335 deletions.
40 changes: 1 addition & 39 deletions files/9940/catalog.json
Original file line number Diff line number Diff line change
@@ -1,39 +1 @@
{
"@context": {
"dcat": "https://www.w3.org/ns/dcat#",
"dcterms": "http://purl.org/dc/terms/",
"foaf": "http://xmlns.com/foaf/0.1/"
},
"@type": "dcat:Catalog",
"dcterms:license": [{
"@id": "https://creativecommons.org/publicdomain/zero/1.0/"
}],
"dcat:dataset": [{
"@type": "dcat:Dataset",
"dcat:keyword": "http://schema.org/Service",
"dcat:distribution": [{
"@type": "dcat:Distribution",
"dcat:accessUrl": "http://smartflanders.ilabt.imec.be/graph/service-example.json",
"dcat:mediaType": "text/html"
}]
},
{
"@type": "dcat:Dataset",
"dcat:keyword": "http://purl.org/vocab/cpsv#PublicService",
"dcat:distribution": [{
"@type": "dcat:Distribution",
"dcat:accessUrl": "http://smartflanders.ilabt.imec.be/graph/service-example.json",
"dcat:mediaType": "text/html"
}]
},
{
"@type": "dcat:Dataset",
"dcat:keyword": "http://data.vlaanderen.be/ns/gebouw#Gebouw",
"dcat:distribution": [{
"@type": "dcat:Distribution",
"dcat:accessUrl": "http://smartflanders.ilabt.imec.be/graph/9940/12568861.json",
"dcat:mediaType": "text/html"
}]
}
]
}
{"@context":{"dcat":"https://www.w3.org/ns/dcat#","dcterms":"http://purl.org/dc/terms/","foaf":"http://xmlns.com/foaf/0.1/"},"@type":"dcat:Catalog","dcterms:license":[{"@id":"https://creativecommons.org/publicdomain/zero/1.0/"}],"dcat:dataset":[{"@type":"dcat:Dataset","dcat:keyword":"http://schema.org/Service","dcat:distribution":[{"@type":"dcat:Distribution","dcat:accessUrl":"http://smartflanders.ilabt.imec.be/graph/service-example.json","dcat:mediaType":"text/html"}]},{"@type":"dcat:Dataset","dcat:keyword":"http://purl.org/vocab/cpsv#PublicService","dcat:distribution":[{"@type":"dcat:Distribution","dcat:accessUrl":"http://smartflanders.ilabt.imec.be/graph/service-example.json","dcat:mediaType":"text/html"}]},{"@type":"dcat:Dataset","dcat:keyword":"http://data.vlaanderen.be/ns/gebouw#Gebouw","dcat:distribution":[{"@type":"dcat:Distribution","dcat:accessUrl":"http://smartflanders.ilabt.imec.be/graph/9940/12568861.json","dcat:mediaType":"text/html"}]},{"@type":"dcat:Dataset","dcat:keyword":"http://data.vlaanderen.be/ns/gebouw#Gebouw","dcat:distribution":[{"@type":"dcat:Distribution","dcat:accessUrl":"http://smartflanders.ilabt.imec.be/graph/12568861.json","dcat:mediaType":"text/html"}]}]}
37 changes: 20 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,40 @@
const express = require('express');
const express = require("express");
const app = express();
const body = require('body-parser');
const morgan = require('morgan');
const cors = require('cors');
const routes = require('./routes');
const path = require('path');
const pug = require('pug');
const body = require("body-parser");
const morgan = require("morgan");
const cors = require("cors");
const routes = require("./routes");
const path = require("path");
const pug = require("pug");

// --- Middlewere
app.use(body.urlencoded({ extended: false }));
app.use(morgan('dev'));
app.use(morgan("dev"));
app.use(cors())

app.use(express.static('public'));
app.use('/graph', express.static('files'));
app.get('/', (req, res) => {
res.render('index');
app.use(express.static("public"));
app.get("/graph", (req, res) => {
res.sendFile(__dirname + "/files/master-catalog.json");
})
app.use("/graph", express.static('files'));
app.get("/", (req, res) => {
res.render("index");
})
// --- Routes
app.use('/', routes)
app.use("/", routes)

// --- Enable PUG template
app.set('views', path.join(__dirname, 'templates'));
app.set('view engine', 'pug');
app.set("views", path.join(__dirname, 'templates'));
app.set("view engine", 'pug');

//
app.use(function(err, req, res, next) {
if(!err.message) err.message = "General error"
res.status(500).send({status:500, message: err.message, type:'internal'});
res.status(500).send({status:500, message: err.message, type:"internal"});
})

/**
* Server listener
* @param {number} - Port number
*/
app.listen(3000, () => console.log('SmartFlanders is running on port 3000'))
app.listen(3000, () => console.log("SmartFlanders is running on port 3000"))
Loading

0 comments on commit e27ccc9

Please sign in to comment.