Skip to content

Commit 66398f4

Browse files
initial commit
0 parents  commit 66398f4

File tree

8 files changed

+1500
-0
lines changed

8 files changed

+1500
-0
lines changed

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.DS_Store
2+
node_modules
3+
/dist
4+
5+
# local env files
6+
.env.local
7+
.env.*.local
8+
9+
# Log files
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
14+
# Editor directories and files
15+
.idea
16+
.vscode
17+
*.suo
18+
*.ntvs*
19+
*.njsproj
20+
*.sln
21+
*.sw?

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Obscura
2+
3+
## Authors
4+
* Alba, Axel
5+
* Murillo, Martin
6+
* Velasco, Dan
7+
8+
## Project setup
9+
```
10+
npm install
11+
```
12+
13+
### Start development server
14+
```
15+
npm run dev
16+
```

index.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
const express = require('express');
2+
const hbs = require('express-handlebars');
3+
const app = express();
4+
const path = require('path');
5+
const port = 3000;
6+
7+
// Serve static files
8+
app.use(express.static('public'));
9+
10+
// Setup handlebars
11+
app.set('view engine', 'hbs'); // Set template
12+
app.set('views', path.join(__dirname, '/src/views')); // Set views path
13+
app.engine('hbs', hbs({ // HBS Config
14+
extname: 'hbs',
15+
defaultView: 'default',
16+
layoutsDir: __dirname + '/src/views/layouts/',
17+
partialsDir: __dirname + '/src/views/partials/',
18+
}));
19+
20+
// Route Handlers
21+
app.get('/', (req, res) => {
22+
res.render('home', {
23+
heading: 'Welcome!',
24+
description: 'This wat app is an academic journal. It provides an overview of my academic life. hope it resets'
25+
});
26+
});
27+
28+
29+
app.listen(port, () => console.log(`Listening to ${port}`));
30+

0 commit comments

Comments
 (0)