Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Low-Fat-Lard committed Oct 1, 2022
0 parents commit 051a301
Show file tree
Hide file tree
Showing 882 changed files with 201,827 additions and 0 deletions.
86 changes: 86 additions & 0 deletions .replit
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
entrypoint = "index.js"

hidden = [".config"]

[interpreter]
command = [
"prybar-nodejs",
"-q",
"--ps1",
"\u0001\u001b[33m\u0002\u0001\u001b[00m\u0002 ",
"-i"
]

[[hints]]
regex = "Error \\[ERR_REQUIRE_ESM\\]"
message = "We see that you are using require(...) inside your code. We currently do not support this syntax. Please use 'import' instead when using external modules. (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)"

[nix]
channel = "stable-22_05"

[env]
XDG_CONFIG_HOME = "/home/runner/.config"
PATH = "/home/runner/$REPL_SLUG/.config/npm/node_global/bin:/home/runner/$REPL_SLUG/node_modules/.bin"
npm_config_prefix = "/home/runner/$REPL_SLUG/.config/npm/node_global"

[gitHubImport]
requiredFiles = [".replit", "replit.nix", ".config"]

[packager]
language = "nodejs"

[packager.features]
packageSearch = true
guessImports = true
enabledForHosting = false

[unitTest]
language = "nodejs"

[debugger]
support = true

[debugger.interactive]
transport = "localhost:0"
startCommand = [ "dap-node" ]

[debugger.interactive.initializeMessage]
command = "initialize"
type = "request"

[debugger.interactive.initializeMessage.arguments]
clientID = "replit"
clientName = "replit.com"
columnsStartAt1 = true
linesStartAt1 = true
locale = "en-us"
pathFormat = "path"
supportsInvalidatedEvent = true
supportsProgressReporting = true
supportsRunInTerminalRequest = true
supportsVariablePaging = true
supportsVariableType = true

[debugger.interactive.launchMessage]
command = "launch"
type = "request"

[debugger.interactive.launchMessage.arguments]
args = []
console = "externalTerminal"
cwd = "."
environment = []
pauseForSourceMap = false
program = "./index.js"
request = "launch"
sourceMaps = true
stopOnEntry = false
type = "pwa-node"

[languages]

[languages.javascript]
pattern = "**/{*.js,*.jsx,*.ts,*.tsx}"

[languages.javascript.languageServer]
start = "typescript-language-server --stdio"
5 changes: 5 additions & 0 deletions database.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": ["Hello world"],
"posturl": ["test"],
"content": ["My first blog post"]
}
41 changes: 41 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
// Declare express
const express = require('express');

// Declare database and requitment
const JSONdb = require('simple-json-db');
const db = new JSONdb('database.json');

// Declare port
const app = express();
const port = 4040;

// Set view engine
app.set('view engine', 'ejs');

// Set main page
app.get('/', (req, res) => {
app.locals.title = db.get('title');
app.locals.postUrl = db.get('posturl');

res.render('index');
})

// Set blog page
app.get('/post/:posturl', (req, res) => {
postUrl = req.params.posturl;
dbIndex = db.get('posturl').indexOf(postUrl);

if (dbIndex != -1) {
app.locals.title = db.get('title')[dbIndex];
app.locals.content = db.get('content')[dbIndex];

res.render('post');
} else {
res.send('Page not found :(')
}
});

// Run app
app.listen(port, () => {
console.log('App is live');
});
1 change: 1 addition & 0 deletions node_modules/.bin/ejs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/jake

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 051a301

Please sign in to comment.