Initial express.js project structure
This commit is contained in:
parent
26a7ab742e
commit
d71d78319a
25
.gitignore
vendored
25
.gitignore
vendored
@ -1,23 +1,2 @@
|
||||
# ---> Go
|
||||
# If you prefer the allow list template instead of the deny list, see community template:
|
||||
# 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
|
||||
|
||||
# NPM dependencies
|
||||
node_modules/
|
||||
|
2
LICENSE
2
LICENSE
@ -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:
|
||||
|
||||
|
17
index.js
Normal file
17
index.js
Normal 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
1670
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
25
package.json
Normal file
25
package.json
Normal 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
3
routes/home.js
Normal file
@ -0,0 +1,3 @@
|
||||
exports.getIndex = function(req, res) {
|
||||
res.render('index');
|
||||
};
|
4
views/index.pug
Normal file
4
views/index.pug
Normal file
@ -0,0 +1,4 @@
|
||||
extends layout.pug
|
||||
|
||||
block content
|
||||
p This is a test.
|
6
views/layout.pug
Normal file
6
views/layout.pug
Normal file
@ -0,0 +1,6 @@
|
||||
doctype html
|
||||
html(lang="en")
|
||||
head
|
||||
title= pageTitle
|
||||
body
|
||||
block content
|
Loading…
Reference in New Issue
Block a user