example conf, change domain
This commit is contained in:
parent
b3be02c15c
commit
bbc7bb6033
2 changed files with 31 additions and 4 deletions
|
@ -39,7 +39,7 @@ async function main(type) {
|
|||
user = user.slice(1);
|
||||
|
||||
if (typed == '#') {
|
||||
studios[user] = await (fetch(`https://hf.zenoverse.net/studio/${user}`)
|
||||
studios[user] = await (fetch(`https://feed.zenoverse.net/studio/${user}`)
|
||||
.then(x => x.json()));
|
||||
}
|
||||
}
|
||||
|
@ -57,20 +57,20 @@ async function main(type) {
|
|||
let extraFetch = [];
|
||||
|
||||
if (typed == '#' && type == '#user') {
|
||||
extraFetch = await (fetch(`https://hf.zenoverse.net/studio_project/${user}`)
|
||||
extraFetch = await (fetch(`https://feed.zenoverse.net/studio_project/${user}`)
|
||||
.then(x => x.json()));
|
||||
extraFetch.forEach(x => {
|
||||
x.studio = studios[user ].title;
|
||||
});
|
||||
} else if (typed == '#' && type == '#comment') {
|
||||
extraFetch = await (fetch(`https://hf.zenoverse.net/studio_comment/${user}`)
|
||||
extraFetch = await (fetch(`https://feed.zenoverse.net/studio_comment/${user}`)
|
||||
.then(x => x.json()));
|
||||
extraFetch.forEach(x => {
|
||||
x.studio = studios[user].title;
|
||||
x.studioID = user
|
||||
});
|
||||
} else if (typed == '@' && type == '#user') {
|
||||
extraFetch = await (fetch(`https://hf.zenoverse.net/user/${user}`)
|
||||
extraFetch = await (fetch(`https://feed.zenoverse.net/user/${user}`)
|
||||
.then(x => x.json()));
|
||||
extraFetch.forEach(x => x.username = user);
|
||||
}
|
||||
|
|
27
nginx.example.conf
Normal file
27
nginx.example.conf
Normal file
|
@ -0,0 +1,27 @@
|
|||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name feed.zenoverse.net;
|
||||
ssl_certificate /etc/letsencrypt/live/feed.zenoverse.net/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/feed.zenoverse.net/privkey.pem;
|
||||
location / {
|
||||
index index.html;
|
||||
root /main/scratch-feed;
|
||||
}
|
||||
location ~ /user/(.*) {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
proxy_pass https://api.scratch.mit.edu/users/$1/projects?limit=40;
|
||||
}
|
||||
location ~ /studio/(.*) {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
proxy_pass https://api.scratch.mit.edu/studios/$1;
|
||||
}
|
||||
location ~ /studio_project/(.*) {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
proxy_pass https://api.scratch.mit.edu/studios/$1/projects?offset=0&limit=40;
|
||||
}
|
||||
location ~ /studio_comment/(.*) {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
proxy_pass https://api.scratch.mit.edu/studios/$1/comments?offset=0&limit=40;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue