Skip to content

Commit

Permalink
Libraries update. Includes pug@3.0.1 crit update.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Karaulshchikov authored and stefanogermano committed Mar 24, 2023
1 parent d619e14 commit 1a20c5e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 24 deletions.
13 changes: 8 additions & 5 deletions app.js
Expand Up @@ -27,7 +27,7 @@ const resourcesPath = currentEnv == environment.prod ? path.dist : path.src

// System config loading
var properties = require('./config/app-config.json');
var loideUrl = properties.loide_url;
var loideUrl = properties.loide_url;
var httpPort = properties.port.http;
var httpsPortP = properties.port.https;
var key = properties.path.key;
Expand All @@ -38,7 +38,8 @@ var maxAge = properties.max_age;
var servicesConfig = require('./config/services.json');

// This function validates the JSON schemas
var Ajv = require('ajv');
var Ajv = require('ajv');
var formats = require('ajv-formats');
validateJsonSchemas();

var pckg = require('./package.json');
Expand Down Expand Up @@ -185,11 +186,13 @@ function validateSchema(jsonPath, schemaPath) {
var schema = require(schemaPath);

// Config
var ajv = new Ajv({
allErrors: true,
jsonPointers: true
var ajv = new Ajv.default({
allErrors: true
});

// Adding format support
formats(ajv);

// Compiling the schema
var compiledSchema = ajv.compile(schema);
var validated = false;
Expand Down
11 changes: 3 additions & 8 deletions config/app-config-schema.json
@@ -1,19 +1,14 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "app-config-schema.json",
"self": {
"vendor": "unical",
"name": "app-config",
"format": "jsonschema",
"version": "1-0-0"
},
"title": "Configurations",
"description": "LoIDE configurations",
"type": "object",
"properties": {
"loide_url": {
"title": "LoIDE URL",
"description": "This is the URL where the application can be reached",
"type": "string",
"minimum": 0
"type": "string"
},
"max_age": {
"title": "HSTS max age",
Expand Down
14 changes: 6 additions & 8 deletions config/services-schema.json
@@ -1,12 +1,9 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "services-schema.json",
"self": {
"vendor": "unical",
"name": "services",
"format": "jsonschema",
"version": "1-0-0"
},
"title": "Services",
"description": "Services tha LoIDE runs",
"type": "object",
"properties": {
"languages": {
"title": "Supported languages.",
Expand Down Expand Up @@ -54,7 +51,8 @@
"path": {
"title": "Syntax-Highlighter path.",
"description": "This property indicates the syntax-highlighter file path.",
"type": "string"
"type": "string",
"format": "uri-reference"
}
},
"required": [
Expand Down Expand Up @@ -181,7 +179,7 @@
"title": "Executor path.",
"description": "This property indicates the executor path relative to its URL.",
"type": "string",
"_comment": "Add the pattern to match with the 'path'."
"format": "uri-reference"
},
"port": {
"title": "Connection port number.",
Expand Down
7 changes: 4 additions & 3 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "loide",
"version": "2.10.1",
"version": "2.11.0",
"description": "Web-based IDE for Logic Programming",
"main": "app.js",
"scripts": {
Expand Down Expand Up @@ -44,12 +44,13 @@
"url": "https://github.com/DeMaCS-UNICAL/LoIDE/issues"
},
"dependencies": {
"ajv": "^6.12.4",
"ajv": "^8.0.5",
"ajv-formats": "^2.0.2",
"express": "^4.17.1",
"express-force-ssl": "^0.3.2",
"helmet": "^3.21.1",
"json-pointer": "^0.6.0",
"pug": "^3.0.0",
"pug": "^3.0.1",
"socket.io": "^2.3.0",
"websocket": "^1.0.32"
},
Expand Down

0 comments on commit 1a20c5e

Please sign in to comment.