Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5d2fd6674f | ||
|
|
2a128f49ab | ||
|
|
b5403fbc0c | ||
|
|
39aff9d684 | ||
|
|
90eff2d619 | ||
|
|
1f7c52a37b | ||
|
|
277ec48ee6 | ||
|
|
cf4c84df5f | ||
|
|
a358896c03 | ||
|
|
3e0462b74b | ||
|
|
1fc48b52e3 | ||
|
|
0850426683 | ||
|
|
6c67113227 | ||
|
|
b8f41fe691 | ||
|
|
1ba2a430fe | ||
|
|
9d44aa5d4e | ||
|
|
4b0f683901 | ||
|
|
7a23117328 | ||
|
|
bd3782cd93 | ||
|
|
09ed207ab6 | ||
|
|
f3f90df38e | ||
|
|
dfe2436718 | ||
|
|
120d6b6941 | ||
|
|
b4440c8cc9 | ||
|
|
da9024548d | ||
|
|
bb923a69e7 | ||
|
|
faaf082c8b | ||
|
|
79c9398981 | ||
|
|
bc785a0077 | ||
|
|
1a5bc59a99 | ||
|
|
f4f9092fe8 | ||
|
|
3e85246344 | ||
|
|
740c584378 | ||
|
|
376f8099b9 | ||
|
|
c8789bc39e | ||
|
|
db3c56cfd8 | ||
|
|
25b90a3432 | ||
|
|
0cab1479f2 | ||
|
|
8acedc284b | ||
|
|
ec8bc54437 | ||
|
|
1904301eae | ||
|
|
b879a4d400 | ||
|
|
c096acdf7d | ||
|
|
b0cd041fd9 | ||
|
|
df3ff8f27c | ||
|
|
bb7e8f9c89 | ||
|
|
04957ad2fc | ||
|
|
914e700056 | ||
|
|
777339c3e1 | ||
|
|
62128bd65b | ||
|
|
d23db35657 | ||
|
|
d966729f7e | ||
|
|
1a42c6ef77 | ||
|
|
318ab4c6ca | ||
|
|
2c7f327892 | ||
|
|
7506909670 | ||
|
|
037c638427 | ||
|
|
78c7ef8809 | ||
|
|
a93722a356 | ||
|
|
a6bf99c945 | ||
|
|
a910feda62 | ||
|
|
cf1ef4257c | ||
|
|
fb5fc2ede2 | ||
|
|
ce4d17974b | ||
|
|
0c566af9a7 | ||
|
|
d6c920bf86 | ||
|
|
f9f9f7010c | ||
|
|
fd991f3dcc | ||
|
|
89e22861af | ||
|
|
3d93b6ddb8 | ||
|
|
418fc1fad4 | ||
|
|
7f0d95b870 | ||
|
|
a8736826bf | ||
|
|
1a76d0d426 | ||
|
|
09a5a7438c | ||
|
|
f948e833e9 | ||
|
|
494f5b5c07 | ||
|
|
760677ce90 | ||
|
|
ffe62b6380 | ||
|
|
dd4e2ca9fb | ||
|
|
aab9885242 | ||
|
|
d8b038dc9c | ||
|
|
43d28f7f6b | ||
|
|
4324e569ca | ||
|
|
56fffda0fe | ||
|
|
9fdbd1b6a1 | ||
|
|
cb3f9b60b9 | ||
|
|
eec3738464 | ||
|
|
43482fcb2e | ||
|
|
69eff0ae21 | ||
|
|
e8139ef878 | ||
|
|
1ed4ba3a4a | ||
|
|
64148746f1 | ||
|
|
e9b9f01101 | ||
|
|
0dd0ac74e1 | ||
|
|
4ef296269c |
@@ -1,4 +1,2 @@
|
|||||||
**/node_modules
|
|
||||||
**/dist
|
|
||||||
.git
|
.git
|
||||||
.gitignore
|
.gitignore
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
* text=auto
|
||||||
|
eol=lf
|
||||||
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
name: Node.js CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master, beta ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
env:
|
|
||||||
CLIENT_DIR: ./client
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [10.x, 12.x, 13.x]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
- run: npm ci
|
|
||||||
working-directory: ${{env.CLIENT_DIR}}
|
|
||||||
- run: npm run build --if-present
|
|
||||||
working-directory: ${{env.CLIENT_DIR}}
|
|
||||||
- run: npm test
|
|
||||||
working-directory: ${{env.CLIENT_DIR}}
|
|
||||||
env:
|
|
||||||
CI: true
|
|
||||||
-22
@@ -1,22 +0,0 @@
|
|||||||
## Node ###
|
|
||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
*.pid.lock
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
node_modules/
|
|
||||||
|
|
||||||
# Build
|
|
||||||
dist/
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
# Personal-Website
|
||||||
|
A nice introduction to my chaos
|
||||||
|
|
||||||
|
## Backstory
|
||||||
|
Instead of calling it my Personal-Website, you could better call it my Personal-Playground.
|
||||||
|
|
||||||
|
This repo is an example of not being afraid to change a codebase around.
|
||||||
|
It shows the journey of achieving code that fits the needs.
|
||||||
|
|
||||||
|
The posts started with pure excitement from building this site.
|
||||||
|
Making my own content and having complete contol over the format thrilled me.
|
||||||
|
For me, it is about making memorable content, something I can proudly look back on.
|
||||||
|
|
||||||
|
Sarcastic, serious and suprising content.
|
||||||
|
Which becomes super silly stuff when looking back at it ;)
|
||||||
|
|
||||||
|
## Content
|
||||||
|
Once in a while you can enjoy a new post on the website.
|
||||||
|
The posts started talking about the website and all changes that came along.
|
||||||
|
As the website is quite far in development, more focus is put into making relaxing content to read through.
|
||||||
|
|
||||||
|
## Experimentations
|
||||||
|
|
||||||
|
- Swapping QA page for a podcast page
|
||||||
|
- Adding a code++ page: page with a collection of helpful code improvements I came across
|
||||||
|
- Adding a portfolio
|
||||||
|
|
||||||
|
## Thank you
|
||||||
|
Thanks for reading all of this!
|
||||||
|
If you have any questions or sugestions, feel free to send an e-mail to me@raymon.dev.
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
**/node_modules
|
|
||||||
**/dist
|
|
||||||
+1
-8
@@ -1,11 +1,4 @@
|
|||||||
FROM node:latest as build-stage
|
|
||||||
WORKDIR /app
|
|
||||||
COPY package*.json ./
|
|
||||||
RUN npm install
|
|
||||||
COPY ./ .
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
FROM nginx as production-stage
|
FROM nginx as production-stage
|
||||||
RUN mkdir /app
|
RUN mkdir /app
|
||||||
COPY --from=build-stage /app/dist /app
|
COPY /public /app
|
||||||
COPY nginx.conf /etc/nginx/nginx.conf
|
COPY nginx.conf /etc/nginx/nginx.conf
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
presets: ['@vue/cli-plugin-babel/preset'],
|
|
||||||
}
|
|
||||||
+22
-2
@@ -7,7 +7,10 @@ events {
|
|||||||
}
|
}
|
||||||
http {
|
http {
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
default_type application/octet-stream;
|
types {
|
||||||
|
application/javascript mjs;
|
||||||
|
}
|
||||||
|
|
||||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||||
'$status $body_bytes_sent "$http_referer" '
|
'$status $body_bytes_sent "$http_referer" '
|
||||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||||
@@ -20,8 +23,25 @@ http {
|
|||||||
location / {
|
location / {
|
||||||
root /app;
|
root /app;
|
||||||
index index.html;
|
index index.html;
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ $uri.html $uri/index.html =404;
|
||||||
}
|
}
|
||||||
|
location /css {
|
||||||
|
alias /app/assets/styling;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /js {
|
||||||
|
alias /app/lib;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /posts {
|
||||||
|
alias /app/gen/;
|
||||||
|
}
|
||||||
|
|
||||||
|
error_page 404 /404.html;
|
||||||
|
location = /404.html {
|
||||||
|
root /app/error;
|
||||||
|
}
|
||||||
|
|
||||||
error_page 500 502 503 504 /50x.html;
|
error_page 500 502 503 504 /50x.html;
|
||||||
location = /50x.html {
|
location = /50x.html {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
|||||||
Generated
-13023
File diff suppressed because it is too large
Load Diff
@@ -1,56 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "personal-website",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"private": true,
|
|
||||||
"description": "A nice introduction to my chaos",
|
|
||||||
"main": "src/main.js",
|
|
||||||
"scripts": {
|
|
||||||
"build": "vue-cli-service build",
|
|
||||||
"lint": "vue-cli-service lint",
|
|
||||||
"serve": "vue-cli-service serve",
|
|
||||||
"test": "node test_runner"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/Raymonzut/Personal-Website.git"
|
|
||||||
},
|
|
||||||
"author": "Raymonzut",
|
|
||||||
"license": "ISC",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/Raymonzut/Personal-Website/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://github.com/Raymonzut/Personal-Website#readme",
|
|
||||||
"dependencies": {
|
|
||||||
"core-js": "^3.6.5",
|
|
||||||
"vue": "^2.6.11",
|
|
||||||
"vue-resource": "^1.5.1",
|
|
||||||
"vue-router": "^3.1.6"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"babel-eslint": "^10.0.3",
|
|
||||||
"eslint": "^6.7.2",
|
|
||||||
"eslint-plugin-vue": "^6.1.2",
|
|
||||||
"@vue/cli-plugin-babel": "~4.2.0",
|
|
||||||
"@vue/cli-plugin-eslint": "~4.2.0",
|
|
||||||
"@vue/cli-service": "~4.2.0",
|
|
||||||
"vue-template-compiler": "^2.6.11"
|
|
||||||
},
|
|
||||||
"eslintConfig": {
|
|
||||||
"root": true,
|
|
||||||
"env": {
|
|
||||||
"node": true
|
|
||||||
},
|
|
||||||
"extends": [
|
|
||||||
"plugin:vue/essential",
|
|
||||||
"eslint:recommended"
|
|
||||||
],
|
|
||||||
"parserOptions": {
|
|
||||||
"parser": "babel-eslint"
|
|
||||||
},
|
|
||||||
"rules": {}
|
|
||||||
},
|
|
||||||
"browserslist": [
|
|
||||||
"> 1%",
|
|
||||||
"last 2 versions"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
posts/*
|
||||||
|
gen/*
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
:root {
|
||||||
|
--primary-color: #272736;
|
||||||
|
--text-color: #ffffeb;
|
||||||
|
|
||||||
|
/* Overriding DP DS */
|
||||||
|
--body-background: var(--primary-color);
|
||||||
|
--body-color: var(--text-color);
|
||||||
|
|
||||||
|
--nav-color: var(--primary-color);
|
||||||
|
--nav-background: var(--text-color);
|
||||||
|
|
||||||
|
--a-color: var(--text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
border-bottom-left-radius: 5px;
|
||||||
|
border-bottom-right-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.question {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2.0em;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 1.25em;
|
||||||
|
margin: auto 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) {
|
||||||
|
:root {
|
||||||
|
--primary-color: #ffffeb;
|
||||||
|
--text-color: #272736;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 420px) {
|
||||||
|
#app {
|
||||||
|
margin-left: 0vw;
|
||||||
|
margin-right: 0vw;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" dir="ltr">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>404</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
This page could not be found, sorry for the inconvenience
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
# Templates will be filled by posts
|
||||||
|
index_template = File.read!("./templates/post_index_page.html")
|
||||||
|
post_template = File.read!("./templates/post_single_page.html")
|
||||||
|
|
||||||
|
post_feed_item_template = File.read!("./templates/post_item.xml")
|
||||||
|
post_feed_template = File.read!("./templates/posts.xml")
|
||||||
|
|
||||||
|
post_contents = File.ls!("./posts")
|
||||||
|
|> Enum.reject(fn(x) -> String.starts_with?(x, ".") end)
|
||||||
|
|> Enum.map(fn f -> File.read!("./posts/" <> f) end)
|
||||||
|
|> Enum.map(fn c -> String.split(c, "\n") end)
|
||||||
|
|> Enum.map(fn c -> Enum.reject(c, fn(x) -> x == "" end) end)
|
||||||
|
|> Enum.map(fn c -> Enum.chunk_every(c, 2) end)
|
||||||
|
|> Enum.map(fn c ->
|
||||||
|
Enum.map(c, fn [k, v] -> %{String.to_atom(k) => v} end)
|
||||||
|
|> Enum.reduce(%{}, fn(x, acc) -> Map.merge(x, acc) end)
|
||||||
|
end)
|
||||||
|
|
||||||
|
index_file = post_contents
|
||||||
|
|> Enum.sort_by(fn m -> Map.get(m, :date) end)
|
||||||
|
|> Enum.reverse()
|
||||||
|
# Group by month
|
||||||
|
|> Enum.group_by(fn m -> Map.get(m, :date) |> String.slice(0..6) end)
|
||||||
|
|> Enum.reverse()
|
||||||
|
|> Enum.map(fn {month, posts} -> "\n<h1>" <> month <> "</h1>\n" <> (posts |>
|
||||||
|
Enum.map(fn post -> "<h2>" <> (Map.get(post, :date) |> String.slice(0..9)) <>
|
||||||
|
" - <a href=\"" <> Map.get(post, :id) <> ".html\">" <> Map.get(post, :title) <> "</a></h2>"
|
||||||
|
end) |> Enum.join("\n")) end)
|
||||||
|
|> (fn template -> Regex.replace(Regex.compile!("{{index}}"), index_template, fn _, __ -> template end) end).()
|
||||||
|
|
||||||
|
File.open!("./gen/index.html", [:write])
|
||||||
|
|> IO.binwrite(index_file)
|
||||||
|
|> File.close()
|
||||||
|
|
||||||
|
|
||||||
|
post_contents
|
||||||
|
|> Enum.each(fn post ->
|
||||||
|
File.open!("./gen/" <> Map.get(post, :id) <> ".html", [:write])
|
||||||
|
|> IO.binwrite(
|
||||||
|
# Converting handlebars to values
|
||||||
|
Regex.compile!("{{(.*)}}") |>
|
||||||
|
Regex.replace(post_template, fn _, key -> if key != "content" do Map.get(post, String.to_atom(key)) else
|
||||||
|
Map.get(post, String.to_atom(key))
|
||||||
|
# Converting \n to paragraphs
|
||||||
|
|> String.split("\\n")
|
||||||
|
|> Enum.reject(fn(x) -> x == "" end)
|
||||||
|
|> Enum.map(fn paragraph -> ("<p>" <> paragraph <> "</p>\n") end)
|
||||||
|
|> Enum.join("")
|
||||||
|
end
|
||||||
|
end))
|
||||||
|
|> File.close()
|
||||||
|
end)
|
||||||
|
|
||||||
|
post_feed = post_contents
|
||||||
|
|> Enum.sort_by(fn m -> Map.get(m, :date) end)
|
||||||
|
|> Enum.reverse()
|
||||||
|
|> Enum.map(fn post ->
|
||||||
|
Regex.compile!("{{(.*)}}") |>
|
||||||
|
Regex.replace(post_feed_item_template, fn _, key -> Map.get(post, String.to_atom(key))
|
||||||
|
end)
|
||||||
|
end)
|
||||||
|
|> Enum.join("\n")
|
||||||
|
|> (fn items -> (Regex.compile!("{{items}}") |>
|
||||||
|
Regex.replace(post_feed_template, fn _, __ -> items end))
|
||||||
|
end).()
|
||||||
|
|
||||||
|
File.open!("./gen/rss.xml", [:write])
|
||||||
|
|> IO.binwrite(post_feed)
|
||||||
|
|> File.close()
|
||||||
@@ -1,18 +1,53 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE-edge">
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Raymon's personal website about his life and projects with a blog.">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Personal Website</title>
|
<title>Raymon Zutekouw</title>
|
||||||
|
|
||||||
|
<link rel="preload" href="./lib/me.mjs" as="script" crossorigin="anonymous" type="application/javascript">
|
||||||
|
<link rel="preload" href="index.mjs" as="script" crossorigin="anonymous" type="application/javascript">
|
||||||
|
<link rel="dns-prefetch" href="https://cdn.statically.io">
|
||||||
|
|
||||||
|
<link defer
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://cdn.statically.io/gh/dragonprojects/dragondesign/master/main.min.css"
|
||||||
|
media="all"
|
||||||
|
>
|
||||||
|
<link defer rel="stylesheet" href="/css/general.css" media="all">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<div id="app">
|
||||||
<strong>This site doesn't work properly without JavaScript enabled. Please enable to continue.</strong>
|
<nav>
|
||||||
</noscript>
|
<a href="/">Home</a>|
|
||||||
<div id="app"></div>
|
<a href="/posts">Posts</a>|
|
||||||
</body>
|
<a href="/qa">QA</a>
|
||||||
|
</nav>
|
||||||
|
<h1>Home</h1>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
Hi there, good to see you on my website.
|
||||||
|
My name is Raymon Zutekouw (<span id="age">born on 29-08-2002</span>)
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Building software and exploring the wide variety of tools (or making them) is my passion.
|
||||||
|
To see it in action, checkout the stuff I make on
|
||||||
|
<a href='https://github.com/Raymonzut'>GitHub</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
The projects that may be useful to others are open source; for inspiring others and improving each others work.
|
||||||
|
That is why I am a huge fan of
|
||||||
|
<a href='https://www.gnu.org/philosophy/free-sw.en.html'>free software</a>.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script async type="module" src="index.mjs"></script>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import { age } from "./lib/me.mjs"
|
||||||
|
|
||||||
|
const age_span = document.getElementById("age")
|
||||||
|
age_span.textContent = age().toString()
|
||||||
@@ -1,21 +1,17 @@
|
|||||||
module.exports = {
|
export function age() {
|
||||||
age: age,
|
let birthdate = new Date("29 August 2002")
|
||||||
}
|
|
||||||
|
|
||||||
function age() {
|
|
||||||
let birthdate = new Date(2002, 8, 29)
|
|
||||||
let now = new Date()
|
let now = new Date()
|
||||||
|
|
||||||
let age = now.getFullYear() - birthdate.getFullYear()
|
let age = now.getFullYear() - birthdate.getFullYear()
|
||||||
|
|
||||||
if (now.getMonth() < birthdate.getMonth()) {
|
if (now.getMonth() < birthdate.getMonth())
|
||||||
age--
|
age--
|
||||||
}
|
|
||||||
if (
|
if (
|
||||||
birthdate.getMonth() === now.getMonth() &&
|
birthdate.getMonth() === now.getMonth() &&
|
||||||
now.getDate() < birthdate.getDate()
|
now.getDate() < birthdate.getDate()
|
||||||
) {
|
)
|
||||||
age--
|
age--
|
||||||
}
|
|
||||||
return age
|
return age
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Raymon answering common questions">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Raymon Zutekouw</title>
|
||||||
|
|
||||||
|
<link defer
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://cdn.statically.io/gh/dragonprojects/dragondesign/master/main.min.css"
|
||||||
|
media="all"
|
||||||
|
>
|
||||||
|
<link defer rel="stylesheet" href="/css/general.css" media="all">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app">
|
||||||
|
<nav>
|
||||||
|
<a href="/">Home</a>|
|
||||||
|
<a href="/posts">Posts</a>|
|
||||||
|
<a href="/qa">QA</a>
|
||||||
|
</nav>
|
||||||
|
<div>
|
||||||
|
<h4 class="question">What is this site about?</h4>
|
||||||
|
<h4>This site is about me and the stuff I make</h4>
|
||||||
|
|
||||||
|
<h4 class="question">Why is it still so empty?</h4>
|
||||||
|
<h4>Because I am framework hopping and now ditching frameworks all together</h4>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Executable
+1
@@ -0,0 +1 @@
|
|||||||
|
User-agent: *
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Raymon typing nonsense on his blog">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Raymon Zutekouw</title>
|
||||||
|
|
||||||
|
<link defer
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://cdn.statically.io/gh/dragonprojects/dragondesign/master/main.min.css"
|
||||||
|
media="all"
|
||||||
|
>
|
||||||
|
<link defer rel="stylesheet" href="/css/general.css" media="all">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<nav>
|
||||||
|
<a href="/">Home</a>|
|
||||||
|
<a href="/posts">Posts</a>|
|
||||||
|
<a href="/qa">QA</a>
|
||||||
|
</nav>
|
||||||
|
<header>
|
||||||
|
<h1>Post listing</h1>
|
||||||
|
</header>
|
||||||
|
{{index}}
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<item>
|
||||||
|
<title>{{title}}</title>
|
||||||
|
<link>https://raymon.dev/posts/{{id}}.html</link>
|
||||||
|
<guid>https://raymon.dev/posts/{{id}}.html</guid>
|
||||||
|
<description>
|
||||||
|
<![CDATA[
|
||||||
|
{{content}}
|
||||||
|
]]>
|
||||||
|
</description>
|
||||||
|
<content type="html">
|
||||||
|
{{content}}
|
||||||
|
</content>
|
||||||
|
<pubDate>{{date}}</pubDate>
|
||||||
|
</item>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="Raymon typing nonsense on his blog">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Raymon Zutekouw</title>
|
||||||
|
|
||||||
|
<link defer
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://cdn.statically.io/gh/dragonprojects/dragondesign/master/main.min.css"
|
||||||
|
media="all"
|
||||||
|
>
|
||||||
|
<link defer rel="stylesheet" href="/css/general.css" media="all">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<nav>
|
||||||
|
<a href="/">Home</a>|
|
||||||
|
<a href="/posts">Posts</a>|
|
||||||
|
<a href="/qa">QA</a>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<article>
|
||||||
|
<header>
|
||||||
|
<h1>{{title}}</h1>
|
||||||
|
<h3>For those using a RSS reader, subscribe here: <a href="/posts/rss.xml">rss.xml</a></h3>
|
||||||
|
</header>
|
||||||
|
<time datetime="{{date}}"></time>
|
||||||
|
{{content}}
|
||||||
|
</article>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
|
<channel>
|
||||||
|
<atom:link href="https://raymon.dev/api/posts/rss.xml" rel="self" type="application/rss+xml" />
|
||||||
|
<title>Posts</title>
|
||||||
|
<link>https://raymon.dev</link>
|
||||||
|
<description>Personal blog</description>
|
||||||
|
<language>en-us</language>
|
||||||
|
|
||||||
|
{{items}}
|
||||||
|
</channel>
|
||||||
|
</rss>
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="app">
|
|
||||||
<div id="nav">
|
|
||||||
<router-link to="/">Home</router-link> |
|
|
||||||
<router-link to="/posts">Posts</router-link> |
|
|
||||||
<router-link to="/qa">QA</router-link>
|
|
||||||
</div>
|
|
||||||
<router-view />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'App',
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
#app {
|
|
||||||
font-family: Avenir, Helvetica, Arial, sans-serif;
|
|
||||||
-webkit-font-smoothing: antialiased;
|
|
||||||
-moz-osx-font-smoothing: grayscale;
|
|
||||||
text-align: center;
|
|
||||||
color: #2c3e50;
|
|
||||||
margin-top: 60px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.7 KiB |
@@ -1,34 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<h2>Who am I?</h2>
|
|
||||||
<p>
|
|
||||||
Hi there, good to see you on my website.
|
|
||||||
My name is Raymon Zutekouw({{ age }}).
|
|
||||||
Building software and exploring the wide variety of tools (or making them) is my passion.
|
|
||||||
To see it in action, checkout the stuff I make on
|
|
||||||
<a href='https://github.com/Raymonzut'>GitHub</a>.
|
|
||||||
The projects that may be useful to others are open source; for inspiring others and improving each others work.
|
|
||||||
That is why I am a huge fan of
|
|
||||||
<a href='https://www.gnu.org/philosophy/free-sw.en.html'>free software</a>.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import me from '../me.js'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'AboutMe',
|
|
||||||
computed: {
|
|
||||||
age: me.age
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
p {
|
|
||||||
--margin-side: 12vw;
|
|
||||||
margin-left: var(--margin-side);
|
|
||||||
margin-right: var(--margin-side);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
{{ a }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'Answer',
|
|
||||||
props: {
|
|
||||||
a: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id='qa'>
|
|
||||||
<Question :q='q'></Question>
|
|
||||||
<Answer :a='a'></Answer>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Question from './Question.vue'
|
|
||||||
import Answer from './Answer.vue'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'QA',
|
|
||||||
components: {
|
|
||||||
Question,
|
|
||||||
Answer,
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
q: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
a: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
#qa {
|
|
||||||
--block-spacing: 7.5em;
|
|
||||||
|
|
||||||
margin-top: var(--block-spacing);
|
|
||||||
margin-bottom: var(--block-spacing);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id='question_box'>
|
|
||||||
{{ q }}
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'Question',
|
|
||||||
props: {
|
|
||||||
q: {
|
|
||||||
type: String,
|
|
||||||
required: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
#question_box {
|
|
||||||
--text-spacing: 0.75em;
|
|
||||||
|
|
||||||
font-style: italic;
|
|
||||||
margin-top: var(--text-spacing);
|
|
||||||
margin-bottom: var(--text-spacing);
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import VueResource from 'vue-resource'
|
|
||||||
|
|
||||||
import App from './App.vue'
|
|
||||||
import router from './router'
|
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
|
||||||
|
|
||||||
Vue.use(VueResource)
|
|
||||||
|
|
||||||
new Vue({
|
|
||||||
render: h => h(App),
|
|
||||||
router,
|
|
||||||
}).$mount('#app')
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
getPosts: function(id) {
|
|
||||||
const BASE_URL = '/api/posts'
|
|
||||||
const URL = BASE_URL + (id ? `/${id}` : '?sort=-1')
|
|
||||||
|
|
||||||
this.$http
|
|
||||||
.get(URL)
|
|
||||||
.then(res => {
|
|
||||||
if (id) {
|
|
||||||
if (res.body.length === 0) {
|
|
||||||
throw Error("Response body empty")
|
|
||||||
}
|
|
||||||
this.post = res.body
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.posts = res.body
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.log(`Error: ${err}`)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
import Vue from 'vue'
|
|
||||||
import VueRouter from 'vue-router'
|
|
||||||
import Home from '../views/Home.vue'
|
|
||||||
import Posts from '../views/Posts.vue'
|
|
||||||
import Post from '../views/Post.vue'
|
|
||||||
import QAPage from '../views/QAPage'
|
|
||||||
|
|
||||||
Vue.use(VueRouter)
|
|
||||||
|
|
||||||
const routes = [
|
|
||||||
{
|
|
||||||
path: "/",
|
|
||||||
name: "Home",
|
|
||||||
component: Home,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "/posts",
|
|
||||||
name: "Posts",
|
|
||||||
component: Posts,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "/posts/:id",
|
|
||||||
name: "Post",
|
|
||||||
component: Post,
|
|
||||||
props: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "/qa",
|
|
||||||
name: "QA",
|
|
||||||
component: QAPage
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
const exclude_routes = [
|
|
||||||
{
|
|
||||||
path: "/api"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
const router = new VueRouter({
|
|
||||||
mode: "history",
|
|
||||||
base: process.env.BASE_URL,
|
|
||||||
routes: routes.concat(exclude_routes),
|
|
||||||
})
|
|
||||||
|
|
||||||
export default router
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="home">
|
|
||||||
<h1>Home</h1>
|
|
||||||
<AboutMe></AboutMe>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import AboutMe from '@/components/AboutMe'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Home",
|
|
||||||
components: {
|
|
||||||
AboutMe
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped></style>
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="Post">
|
|
||||||
<div v-if="Object.keys(post).length">
|
|
||||||
<h1>{{ post.title }}</h1>
|
|
||||||
<h5>Written on {{ post.date.substring(0,10)}}</h5>
|
|
||||||
|
|
||||||
<p v-for="(p, i) in post.content.split('\n')" :key="i">{{ p }}</p>
|
|
||||||
</div>
|
|
||||||
<h2 v-else>Waiting for post</h2>
|
|
||||||
<br>
|
|
||||||
Read other <a href="/posts">posts</a>
|
|
||||||
<br>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getPosts } from '../remote'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Post",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
post: {},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getPosts
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
getPosts.call(this, this._props.id)
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
id: {
|
|
||||||
type: String,
|
|
||||||
name: "id",
|
|
||||||
validator: val => {
|
|
||||||
const reg = /([0-9]|[a-f]){24}/
|
|
||||||
return reg.test(val)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped></style>
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="posts" v-if="months.length >= 0">
|
|
||||||
<h3 class="month" v-for="(month, i) in months" :key="i">
|
|
||||||
{{ month }}
|
|
||||||
<div>
|
|
||||||
<ul>
|
|
||||||
<li v-for="(postItem, j) in getPostItems(month)" :key="j">
|
|
||||||
{{ getPostItemDate(postItem) }} –
|
|
||||||
<a :href="/posts/ + postItem._id">{{ postItem.title }}</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<br>
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
<h2 v-else>There are no posts yet, but don't worry they will be added soon</h2>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getPosts } from '../remote'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "Posts",
|
|
||||||
computed: {
|
|
||||||
months: function () {
|
|
||||||
const dates = this.posts.map(post => new Date(post.date))
|
|
||||||
|
|
||||||
// Contains the month followed by the year
|
|
||||||
const months = dates.map(date => `${date.toLocaleString('default', { month: 'long' })} ${date.getFullYear()}`)
|
|
||||||
const uniques = Array.from(new Set(months))
|
|
||||||
|
|
||||||
return uniques
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
posts: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getPosts,
|
|
||||||
getPostItems: function (month) {
|
|
||||||
const month_index = new Date(`1 ${month}`).getMonth()
|
|
||||||
return this.posts.filter((post) => (new Date(post.date)).getMonth() === month_index)
|
|
||||||
},
|
|
||||||
getPostItemDate: function (postItem) {
|
|
||||||
const date = new Date(postItem.date)
|
|
||||||
return `${date.getFullYear()} ${date.toLocaleString('default', { month: 'short' })} ${date.getDate()}`
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
getPosts.call(this)
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
ul {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (min-width: 420px) {
|
|
||||||
.month {
|
|
||||||
text-indent: 1em;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div id="QAPage">
|
|
||||||
<QA
|
|
||||||
q="What is this site about? "
|
|
||||||
a="This site is about me and the stuff I make "
|
|
||||||
></QA>
|
|
||||||
|
|
||||||
<QA
|
|
||||||
q="Why is it still so empty?"
|
|
||||||
a="Because I am framework hopping "
|
|
||||||
></QA>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import QA from '@/components/QA'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "QAPAge",
|
|
||||||
components: { QA }
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped></style>
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
const assert = require('assert').strict
|
|
||||||
const me = require('../src/me')
|
|
||||||
|
|
||||||
assert(me.age() > 0, 'age should return a positive number')
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
const { spawn } = require('child_process')
|
|
||||||
const fs = require('fs')
|
|
||||||
|
|
||||||
const dirs = ['./test', './tests']
|
|
||||||
|
|
||||||
if (!dirs.some(fs.existsSync)) {
|
|
||||||
throw Error("Could not find any test directories, looked for: " + dirs)
|
|
||||||
}
|
|
||||||
|
|
||||||
const test_dirs = dirs.filter(fs.existsSync)
|
|
||||||
|
|
||||||
test_dirs.forEach(test_dir => {
|
|
||||||
const files = fs.readdirSync(test_dir)
|
|
||||||
|
|
||||||
if (files.length === 0) {
|
|
||||||
throw Error("Could not find test files in " + test_dir)
|
|
||||||
}
|
|
||||||
|
|
||||||
const childs = files.map(file =>
|
|
||||||
spawn('node', [`${test_dir}/${file}`], { stdio: 'inherit' })
|
|
||||||
)
|
|
||||||
})
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version: '3'
|
|
||||||
|
|
||||||
services:
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
**/node_modules
|
|
||||||
**/dist
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
FROM node:latest
|
|
||||||
|
|
||||||
WORKDIR /usr/src/server
|
|
||||||
|
|
||||||
COPY package*.json ./
|
|
||||||
|
|
||||||
RUN npm ci --only=production
|
|
||||||
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
CMD [ "node", "index.js" ]
|
|
||||||
|
|
||||||
EXPOSE 5000
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
const express = require('express')
|
|
||||||
const cors = require('cors')
|
|
||||||
|
|
||||||
const app = express()
|
|
||||||
|
|
||||||
app.use(cors())
|
|
||||||
|
|
||||||
const posts = require('./routes/api/posts')
|
|
||||||
|
|
||||||
app.use('/posts', posts)
|
|
||||||
|
|
||||||
const port = process.env.PORT || 5000
|
|
||||||
|
|
||||||
app.listen(port, () => console.log(`Server started on port ${port}`))
|
|
||||||
Generated
-388
@@ -1,388 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "server",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"lockfileVersion": 1,
|
|
||||||
"requires": true,
|
|
||||||
"dependencies": {
|
|
||||||
"accepts": {
|
|
||||||
"version": "1.3.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
|
|
||||||
"integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
|
|
||||||
"requires": {
|
|
||||||
"mime-types": "~2.1.24",
|
|
||||||
"negotiator": "0.6.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"array-flatten": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
|
||||||
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
|
|
||||||
},
|
|
||||||
"body-parser": {
|
|
||||||
"version": "1.19.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
|
|
||||||
"integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
|
|
||||||
"requires": {
|
|
||||||
"bytes": "3.1.0",
|
|
||||||
"content-type": "~1.0.4",
|
|
||||||
"debug": "2.6.9",
|
|
||||||
"depd": "~1.1.2",
|
|
||||||
"http-errors": "1.7.2",
|
|
||||||
"iconv-lite": "0.4.24",
|
|
||||||
"on-finished": "~2.3.0",
|
|
||||||
"qs": "6.7.0",
|
|
||||||
"raw-body": "2.4.0",
|
|
||||||
"type-is": "~1.6.17"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"bytes": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
|
|
||||||
},
|
|
||||||
"content-disposition": {
|
|
||||||
"version": "0.5.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
|
|
||||||
"integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
|
|
||||||
"requires": {
|
|
||||||
"safe-buffer": "5.1.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"content-type": {
|
|
||||||
"version": "1.0.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
|
|
||||||
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
|
|
||||||
},
|
|
||||||
"cookie": {
|
|
||||||
"version": "0.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
|
|
||||||
"integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
|
|
||||||
},
|
|
||||||
"cookie-signature": {
|
|
||||||
"version": "1.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
|
|
||||||
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
|
|
||||||
},
|
|
||||||
"cors": {
|
|
||||||
"version": "2.8.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
|
|
||||||
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
|
|
||||||
"requires": {
|
|
||||||
"object-assign": "^4",
|
|
||||||
"vary": "^1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"debug": {
|
|
||||||
"version": "2.6.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
|
||||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
|
||||||
"requires": {
|
|
||||||
"ms": "2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"depd": {
|
|
||||||
"version": "1.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
|
|
||||||
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
|
|
||||||
},
|
|
||||||
"destroy": {
|
|
||||||
"version": "1.0.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
|
|
||||||
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
|
|
||||||
},
|
|
||||||
"ee-first": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
|
||||||
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
|
|
||||||
},
|
|
||||||
"encodeurl": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
|
|
||||||
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
|
|
||||||
},
|
|
||||||
"escape-html": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
|
|
||||||
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
|
|
||||||
},
|
|
||||||
"etag": {
|
|
||||||
"version": "1.8.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
|
|
||||||
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
|
|
||||||
},
|
|
||||||
"express": {
|
|
||||||
"version": "4.17.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz",
|
|
||||||
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==",
|
|
||||||
"requires": {
|
|
||||||
"accepts": "~1.3.7",
|
|
||||||
"array-flatten": "1.1.1",
|
|
||||||
"body-parser": "1.19.0",
|
|
||||||
"content-disposition": "0.5.3",
|
|
||||||
"content-type": "~1.0.4",
|
|
||||||
"cookie": "0.4.0",
|
|
||||||
"cookie-signature": "1.0.6",
|
|
||||||
"debug": "2.6.9",
|
|
||||||
"depd": "~1.1.2",
|
|
||||||
"encodeurl": "~1.0.2",
|
|
||||||
"escape-html": "~1.0.3",
|
|
||||||
"etag": "~1.8.1",
|
|
||||||
"finalhandler": "~1.1.2",
|
|
||||||
"fresh": "0.5.2",
|
|
||||||
"merge-descriptors": "1.0.1",
|
|
||||||
"methods": "~1.1.2",
|
|
||||||
"on-finished": "~2.3.0",
|
|
||||||
"parseurl": "~1.3.3",
|
|
||||||
"path-to-regexp": "0.1.7",
|
|
||||||
"proxy-addr": "~2.0.5",
|
|
||||||
"qs": "6.7.0",
|
|
||||||
"range-parser": "~1.2.1",
|
|
||||||
"safe-buffer": "5.1.2",
|
|
||||||
"send": "0.17.1",
|
|
||||||
"serve-static": "1.14.1",
|
|
||||||
"setprototypeof": "1.1.1",
|
|
||||||
"statuses": "~1.5.0",
|
|
||||||
"type-is": "~1.6.18",
|
|
||||||
"utils-merge": "1.0.1",
|
|
||||||
"vary": "~1.1.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"finalhandler": {
|
|
||||||
"version": "1.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
|
|
||||||
"integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
|
|
||||||
"requires": {
|
|
||||||
"debug": "2.6.9",
|
|
||||||
"encodeurl": "~1.0.2",
|
|
||||||
"escape-html": "~1.0.3",
|
|
||||||
"on-finished": "~2.3.0",
|
|
||||||
"parseurl": "~1.3.3",
|
|
||||||
"statuses": "~1.5.0",
|
|
||||||
"unpipe": "~1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"forwarded": {
|
|
||||||
"version": "0.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
|
|
||||||
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
|
|
||||||
},
|
|
||||||
"fresh": {
|
|
||||||
"version": "0.5.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
|
|
||||||
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
|
|
||||||
},
|
|
||||||
"http-errors": {
|
|
||||||
"version": "1.7.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
|
|
||||||
"integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
|
|
||||||
"requires": {
|
|
||||||
"depd": "~1.1.2",
|
|
||||||
"inherits": "2.0.3",
|
|
||||||
"setprototypeof": "1.1.1",
|
|
||||||
"statuses": ">= 1.5.0 < 2",
|
|
||||||
"toidentifier": "1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"iconv-lite": {
|
|
||||||
"version": "0.4.24",
|
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
|
||||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
|
||||||
"requires": {
|
|
||||||
"safer-buffer": ">= 2.1.2 < 3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"inherits": {
|
|
||||||
"version": "2.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
|
|
||||||
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
|
|
||||||
},
|
|
||||||
"ipaddr.js": {
|
|
||||||
"version": "1.9.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
|
|
||||||
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
|
|
||||||
},
|
|
||||||
"media-typer": {
|
|
||||||
"version": "0.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
|
|
||||||
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
|
|
||||||
},
|
|
||||||
"merge-descriptors": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
|
|
||||||
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
|
|
||||||
},
|
|
||||||
"methods": {
|
|
||||||
"version": "1.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
|
|
||||||
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
|
|
||||||
},
|
|
||||||
"mime": {
|
|
||||||
"version": "1.6.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
|
|
||||||
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
|
|
||||||
},
|
|
||||||
"mime-db": {
|
|
||||||
"version": "1.43.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz",
|
|
||||||
"integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ=="
|
|
||||||
},
|
|
||||||
"mime-types": {
|
|
||||||
"version": "2.1.26",
|
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz",
|
|
||||||
"integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==",
|
|
||||||
"requires": {
|
|
||||||
"mime-db": "1.43.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ms": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
|
||||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
|
||||||
},
|
|
||||||
"negotiator": {
|
|
||||||
"version": "0.6.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
|
|
||||||
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
|
|
||||||
},
|
|
||||||
"object-assign": {
|
|
||||||
"version": "4.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
|
||||||
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
|
|
||||||
},
|
|
||||||
"on-finished": {
|
|
||||||
"version": "2.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
|
|
||||||
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
|
|
||||||
"requires": {
|
|
||||||
"ee-first": "1.1.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"parseurl": {
|
|
||||||
"version": "1.3.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
|
||||||
"integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
|
|
||||||
},
|
|
||||||
"path-to-regexp": {
|
|
||||||
"version": "0.1.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
|
|
||||||
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
|
|
||||||
},
|
|
||||||
"proxy-addr": {
|
|
||||||
"version": "2.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
|
|
||||||
"integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
|
|
||||||
"requires": {
|
|
||||||
"forwarded": "~0.1.2",
|
|
||||||
"ipaddr.js": "1.9.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"qs": {
|
|
||||||
"version": "6.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
|
|
||||||
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
|
|
||||||
},
|
|
||||||
"range-parser": {
|
|
||||||
"version": "1.2.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
|
||||||
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
|
|
||||||
},
|
|
||||||
"raw-body": {
|
|
||||||
"version": "2.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
|
|
||||||
"integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
|
|
||||||
"requires": {
|
|
||||||
"bytes": "3.1.0",
|
|
||||||
"http-errors": "1.7.2",
|
|
||||||
"iconv-lite": "0.4.24",
|
|
||||||
"unpipe": "1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"safe-buffer": {
|
|
||||||
"version": "5.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
|
||||||
},
|
|
||||||
"safer-buffer": {
|
|
||||||
"version": "2.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
|
||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
|
||||||
},
|
|
||||||
"send": {
|
|
||||||
"version": "0.17.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
|
|
||||||
"integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
|
|
||||||
"requires": {
|
|
||||||
"debug": "2.6.9",
|
|
||||||
"depd": "~1.1.2",
|
|
||||||
"destroy": "~1.0.4",
|
|
||||||
"encodeurl": "~1.0.2",
|
|
||||||
"escape-html": "~1.0.3",
|
|
||||||
"etag": "~1.8.1",
|
|
||||||
"fresh": "0.5.2",
|
|
||||||
"http-errors": "~1.7.2",
|
|
||||||
"mime": "1.6.0",
|
|
||||||
"ms": "2.1.1",
|
|
||||||
"on-finished": "~2.3.0",
|
|
||||||
"range-parser": "~1.2.1",
|
|
||||||
"statuses": "~1.5.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"ms": {
|
|
||||||
"version": "2.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
|
|
||||||
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"serve-static": {
|
|
||||||
"version": "1.14.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
|
|
||||||
"integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
|
|
||||||
"requires": {
|
|
||||||
"encodeurl": "~1.0.2",
|
|
||||||
"escape-html": "~1.0.3",
|
|
||||||
"parseurl": "~1.3.3",
|
|
||||||
"send": "0.17.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"setprototypeof": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
|
|
||||||
},
|
|
||||||
"statuses": {
|
|
||||||
"version": "1.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
|
|
||||||
"integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
|
|
||||||
},
|
|
||||||
"toidentifier": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
|
|
||||||
},
|
|
||||||
"type-is": {
|
|
||||||
"version": "1.6.18",
|
|
||||||
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
|
|
||||||
"integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
|
|
||||||
"requires": {
|
|
||||||
"media-typer": "0.3.0",
|
|
||||||
"mime-types": "~2.1.24"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"unpipe": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
|
|
||||||
},
|
|
||||||
"utils-merge": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
|
||||||
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
|
|
||||||
},
|
|
||||||
"vary": {
|
|
||||||
"version": "1.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
|
||||||
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "server",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "The API for the website",
|
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"start": "node ./index.js",
|
|
||||||
"dev": "nodemon server/index.js"
|
|
||||||
},
|
|
||||||
"keywords": [],
|
|
||||||
"author": "",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"cors": "^2.8.5",
|
|
||||||
"express": "^4.17.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
*.json
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
All the posts will be in here seperate in JSON format
|
|
||||||
|
|
||||||
post
|
|
||||||
- title
|
|
||||||
- date
|
|
||||||
- content
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
const express = require('express')
|
|
||||||
const fs = require('fs')
|
|
||||||
|
|
||||||
const router = express.Router()
|
|
||||||
|
|
||||||
const posts_dir = 'posts/'
|
|
||||||
|
|
||||||
if (!fs.existsSync(posts_dir)) throw Error(`Missing ${posts_dir}`)
|
|
||||||
|
|
||||||
let posts = readPosts();
|
|
||||||
|
|
||||||
setInterval(() => posts = readPosts(), 1000 * 60 * 60)
|
|
||||||
|
|
||||||
function readPostsDelayed() {
|
|
||||||
return new Promise(setTimeout, 1000).then(posts = readPosts())
|
|
||||||
}
|
|
||||||
|
|
||||||
function readPosts() {
|
|
||||||
console.warn("reading all posts")
|
|
||||||
const files = fs.readdirSync(posts_dir)
|
|
||||||
|
|
||||||
if (files.length === 0) throw Error(`Could not find posts in ${posts_dir}`)
|
|
||||||
|
|
||||||
return files.filter(file_name => file_name.endsWith('.json'))
|
|
||||||
.map(file_name => `${posts_dir}${file_name}`)
|
|
||||||
.map(readJSONAsObject)
|
|
||||||
}
|
|
||||||
|
|
||||||
function readJSONAsObject(filename) {
|
|
||||||
return JSON.parse(fs.readFileSync(filename, 'utf8'))
|
|
||||||
}
|
|
||||||
|
|
||||||
function notFoundResponse(res) {
|
|
||||||
res.status(404).send('Sorry, can not find that')
|
|
||||||
}
|
|
||||||
|
|
||||||
router.get('/', async (req, res) => {
|
|
||||||
if (req.query.sort === '-1' || req.query.sort === '1') {
|
|
||||||
const posts_sorted = posts.sort((a, b) => {
|
|
||||||
return new Date(a.date).getTime() - new Date(b.date).getTime()
|
|
||||||
})
|
|
||||||
|
|
||||||
if (req.query.sort === '1') res.send(posts_sorted)
|
|
||||||
else res.send(posts_sorted.reverse())
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
router.get('/:id', async (req, res) => {
|
|
||||||
const re = /[0-9A-Fa-f]{24}/g
|
|
||||||
|
|
||||||
if (!re.test(req.params.id)) {
|
|
||||||
notFoundResponse(res)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
const results = posts.filter(post => post._id === req.params.id)
|
|
||||||
|
|
||||||
if (!results.length) notFoundResponse(res)
|
|
||||||
else res.send(results[0])
|
|
||||||
})
|
|
||||||
|
|
||||||
module.exports = router
|
|
||||||
Reference in New Issue
Block a user