Initial express.js project structure

This commit is contained in:
Gregory Ballantine 2022-09-25 00:40:25 -04:00
parent 26a7ab742e
commit d71d78319a
8 changed files with 1728 additions and 24 deletions

25
.gitignore vendored
View File

@ -1,23 +1,2 @@
# ---> Go # NPM dependencies
# If you prefer the allow list template instead of the deny list, see community template: node_modules/
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
#
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
# Go workspace file
go.work

View File

@ -1,4 +1,4 @@
Copyright (c) <year> <owner> Copyright (c) 2022 Bit Goblin
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

17
index.js Normal file
View File

@ -0,0 +1,17 @@
const express = require('express');
const app = express();
const port = 3000;
// set template engine to Pug
app.set('view engine', 'pug');
// import route handlers
var homeRoutes = require('./routes/home');
// define routes
app.get('/', homeRoutes.getIndex);
// start Express.js app
app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});

1670
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

25
package.json Normal file
View File

@ -0,0 +1,25 @@
{
"name": "mcst",
"version": "0.1.0",
"description": "Minecraft Java edition server management tool",
"main": "index.js",
"scripts": {
"start": "node index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "gitea@git.metaunix.net:BitGoblin/mcst.git"
},
"keywords": [
"minecraft",
"minecraft java edition",
"java"
],
"author": "Gregory Ballantine <gballantine@bitgoblin.tech>",
"license": "BSD-2-Clause",
"dependencies": {
"express": "^4.18.1",
"pug": "^3.0.2"
}
}

3
routes/home.js Normal file
View File

@ -0,0 +1,3 @@
exports.getIndex = function(req, res) {
res.render('index');
};

4
views/index.pug Normal file
View File

@ -0,0 +1,4 @@
extends layout.pug
block content
p This is a test.

6
views/layout.pug Normal file
View File

@ -0,0 +1,6 @@
doctype html
html(lang="en")
head
title= pageTitle
body
block content