@igea/oac_frontend 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@igea/oac_frontend",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Frontend service for the OAC project",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
7
7
  "start": "cross-env NODE_ENV=production node src/index.js",
8
- "dev": "cross-env NODE_ENV=development nodemon src/index.js"
8
+ "dev": "cross-env NODE_ENV=development nodemon src/index.js",
9
+ "build:scss": "sass src/scss/main.scss src/public/css/style.css",
10
+ "watch:scss": "sass --watch src/scss/main.scss:src/public/css/style.css"
9
11
  },
10
12
  "repository": {
11
13
  "type": "git",
@@ -25,6 +27,7 @@
25
27
  },
26
28
  "devDependencies": {
27
29
  "cross-env": "7.0.3",
28
- "nodemon": "3.1.10"
30
+ "nodemon": "3.1.10",
31
+ "sass": "1.89.2"
29
32
  }
30
33
  }
package/src/index.js CHANGED
@@ -6,7 +6,10 @@ const path = require("path");
6
6
  const serviceName = "frontend"
7
7
 
8
8
  const app = express();
9
+
10
+ app.use(express.static(path.join(__dirname, 'public')));
9
11
  app.use(express.json());
12
+
10
13
  app.set('view engine', 'twig');
11
14
  app.set('views', path.join(__dirname, 'views'));
12
15
 
@@ -14,6 +17,7 @@ getPort.default({
14
17
  port: getPort.portNumbers(config.port_range.min, config.port_range.max) }
15
18
  ).then((newPort)=>{
16
19
 
20
+ // Defining routers
17
21
  const healthRouter = require('./controllers/health.js');
18
22
  app.use('/health', healthRouter);
19
23
 
@@ -22,6 +26,7 @@ getPort.default({
22
26
  res.render('base', { title: 'Home Page', message: 'Hello from Twig!' });
23
27
  });
24
28
 
29
+ // Start listing on the specified port
25
30
  app.listen(newPort, async () => {
26
31
  console.log(`${serviceName} listening on port ${newPort}`);
27
32
  try {
@@ -0,0 +1,7 @@
1
+ body {
2
+ font-family: "Helvetica Neue", Arial, sans-serif;
3
+ font-size: 1rem;
4
+ color: red;
5
+ }
6
+
7
+ /*# sourceMappingURL=style.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sourceRoot":"","sources":["../../scss/_typography.scss","../../scss/_variables.scss"],"names":[],"mappings":"AAGA;EACI,aCFS;EDGT;EACA,OCNY","file":"style.css"}
@@ -0,0 +1,3 @@
1
+ @function rem($pixels){
2
+ @return calc($pixels / 16) * 1rem;
3
+ }
@@ -0,0 +1,3 @@
1
+ @mixin transition($props...){
2
+ transition: $props;
3
+ }
@@ -0,0 +1,8 @@
1
+ @use './variables' as *;
2
+ @use './functions' as *;
3
+
4
+ body {
5
+ font-family: $font-stack;
6
+ font-size: rem(16);
7
+ color: $primary-color;
8
+ }
@@ -0,0 +1,4 @@
1
+ $primary-color: #3498db;
2
+ $secondary-color: #2ecc71;
3
+ $font-stack: 'Helvetica Neue', Arial, sans-serif;
4
+ $border-radius: 4px;
@@ -0,0 +1,4 @@
1
+ @use './variables' as *;
2
+ @use './mixins' as *;
3
+ @use './functions' as *;
4
+ @use './typography';
@@ -2,6 +2,7 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>{{ title }}</title>
5
+ <link rel="stylesheet" type="text/css" href="/frontend/css/style.css">
5
6
  </head>
6
7
  <body>
7
8
  <h1>{{ message }}</h1>