tangled
alpha
login
or
join now
gracekind.net
/
tangled-pages
67
fork
atom
Static site hosting via tangled
67
fork
atom
overview
issues
pulls
pipelines
Update
Grace Kind
6 months ago
e3fc2c1c
019ca3aa
+2
-5
2 changed files
expand all
collapse all
unified
split
package.json
src
worker.js
+1
-3
package.json
···
6
"tangled-pages": "bin/tangled-pages.js"
7
},
8
"scripts": {
9
-
"start": "npm run dev:express",
10
-
"dev": "npm run dev:express",
11
-
"dev:express": "nodemon src/server.js",
12
"dev:worker": "wrangler dev --port 3000"
13
},
14
"dependencies": {
···
6
"tangled-pages": "bin/tangled-pages.js"
7
},
8
"scripts": {
9
+
"start": "npx tangled-pages --config config.example.json",
0
0
10
"dev:worker": "wrangler dev --port 3000"
11
},
12
"dependencies": {
+1
-2
src/worker.js
···
3
4
async function handleSiteRequest(request, site) {
5
const url = new URL(request.url);
6
-
const host = url.host;
7
const route = url.pathname;
8
const pagesService = new PagesService({
9
domain: site.knotDomain,
···
35
}
36
}
37
// Multi site mode
38
-
const matchingSite = config.sites.find(
39
(site) => site.subdomain === subdomain
40
);
41
if (matchingSite) {
···
3
4
async function handleSiteRequest(request, site) {
5
const url = new URL(request.url);
0
6
const route = url.pathname;
7
const pagesService = new PagesService({
8
domain: site.knotDomain,
···
34
}
35
}
36
// Multi site mode
37
+
const matchingSite = config.sites?.find(
38
(site) => site.subdomain === subdomain
39
);
40
if (matchingSite) {