diff --git a/build.js b/build.js new file mode 100644 index 0000000..7e9bb7b --- /dev/null +++ b/build.js @@ -0,0 +1,8 @@ +const { execSync } = require('child_process'); +const { writeFileSync } = require('fs'); +const { join } = require('path'); + +const versionFile = join(__dirname, 'public/views/version.html'); +const version = execSync('git rev-parse HEAD').toString().trim(); + +writeFileSync(versionFile, version); \ No newline at end of file diff --git a/index.js b/index.js index 753c54b..1d26bc3 100644 --- a/index.js +++ b/index.js @@ -51,7 +51,10 @@ app.get("/contact", (req, res) => { app.get("/epik", (req, res) => { return res.sendFile("epik.html", { root: "public/views" }); - //return res.sendFile("damedaepik.mp4", { root: "public/assets" }); +}); + +app.get("/version", (req, res) => { + return res.sendFile("version.html", { root: "public/views" }); }); app.post("/contact", (req, res) => { diff --git a/package.json b/package.json index f8ceee6..1ea5b0d 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "description": "", "main": "index.js", "scripts": { - "start": "node index.js" + "start": "node index.js", + "build": "node build.js" }, "repository": { "type": "git", diff --git a/public/views/version.html b/public/views/version.html new file mode 100644 index 0000000..0c2c1fe --- /dev/null +++ b/public/views/version.html @@ -0,0 +1 @@ +LOCAL \ No newline at end of file