diff --git a/src/download.js b/src/download.js index a87d13f..bf71c2d 100644 --- a/src/download.js +++ b/src/download.js @@ -1,41 +1,8 @@ const express = require('express'); const router = express.Router(); -const axios = require('axios'); -const moment = require('moment'); -let commits = []; - -function cutTitle(title, maxLength) { - return title.length > maxLength ? title.substring(0, maxLength) + '...' : title; -} - -function fetchCommits() { - axios.get('https://api.github.com/repos/TeamHypersomnia/Hypersomnia/commits') - .then(response => { - commits = response.data.slice(0, 5).map(commit => ({ - sha: commit.sha, - date: commit.commit.author.date, - msg: cutTitle(commit.commit.message, 35), - })); - }) - .catch(error => { - console.error(error.message); - }); -} -fetchCommits(); -setInterval(fetchCommits, 600000); // 10 min router.get('/', (req, res) => { - const obj = commits.map(v => { - return { - ...v, - date: moment.utc(v.date).fromNow() - }; - }); - res.render('download', { - page: 'Download', - user: req.user, - commits: obj - }); -}) + res.redirect('/'); +}); module.exports = router; diff --git a/src/index.js b/src/index.js index 28b6bdf..7c0ed0e 100644 --- a/src/index.js +++ b/src/index.js @@ -1,10 +1,40 @@ const express = require('express'); const router = express.Router(); +const axios = require('axios'); +const moment = require('moment'); +let commits = []; + +function cutTitle(title, maxLength) { + return title.length > maxLength ? title.substring(0, maxLength) + '...' : title; +} + +function fetchCommits() { + axios.get('https://api.github.com/repos/TeamHypersomnia/Hypersomnia/commits') + .then(response => { + commits = response.data.slice(0, 5).map(commit => ({ + sha: commit.sha, + date: commit.commit.author.date, + msg: cutTitle(commit.commit.message, 35), + })); + }) + .catch(error => { + console.error(error.message); + }); +} +fetchCommits(); +setInterval(fetchCommits, 600000); // 10 min router.get('/', (req, res) => { + const obj = commits.map(v => { + return { + ...v, + date: moment.utc(v.date).fromNow() + }; + }); res.render('index', { page: 'Index', - user: req.user + user: req.user, + commits: obj }); }) diff --git a/views/download.ejs b/views/download.ejs deleted file mode 100644 index f228e86..0000000 --- a/views/download.ejs +++ /dev/null @@ -1,44 +0,0 @@ -<%- include('overall_header'); %> - -

Download

-
-
-

Play for free on Steam!
Available for Windows, Linux, and MacOS. It's just 50 MB.


- - -
-
- -
-

Latest Commits

- -
-
-
- -<%- include('overall_footer'); %> \ No newline at end of file diff --git a/views/index.ejs b/views/index.ejs index 7811321..4b97b2f 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -1,29 +1,46 @@ <%- include('overall_header'); %> -

Hypersomnia

-

Hypersomnia is a hardcore arena mixing eSports with pixely nostalgia.
-Every match will be unforgiving - every duel a psychological battle.

- -

More of a peaceful soul?
-Unleash your creativity in the WYSIWYG in-game map Editor that lets you instantly playtest your maps online.

- -

It's all free and open-source.
-Written without a game engine, in bare C++. Only 50 MB.
-Feel free to build it yourself from GitHub and modify Hypersomnia to your heart's content.

- -

Features: -

- -

Declare allegiance to one of the three factions whose apple of discord is a disparity between prevailing notions of moral excellence:

- -

Metropolis. Atlantis. Resistance.

- -

Will you take revenge for the unethical simulation of an inferior universe? Will you support the cruel experiments to win total control over metempsychosis? Or will you join the underground civilization that awaits the end of war in this dangerous afterlife reality?

+
+
+

Hypersomnia is a hardcore free and open-source eSports shooter.
It combines the intensity of Counter-Strike with mechanics of Hotline Miami.

+ +

Play for free on Steam!
Available for Windows, Linux, and MacOS. It's just 50 MB.


+ + +
+
+ +
+

Latest Commits

+ +
+
+

Gameplay & Dev Journals