*+ More env flags listed in readme
*! Async requests for category pictures With async requests in place HTTP2 should be defaulted more often now It is recommended now however to enable it with the reverse proxy of choice
This commit is contained in:
parent
c2eb93d3af
commit
683dcffd6f
@ -23,6 +23,12 @@ There are a few environment variables that can be configured:
|
||||
|
||||
* `THUMBS_DIR`: default = `/media/thumbnails`
|
||||
|
||||
* `SITE_NAME`: default = _Clippable_
|
||||
|
||||
* `SITE_DESC`: default = _Short clips_
|
||||
|
||||
* `SITE_URL`: default = `#`
|
||||
|
||||
## Building the backend
|
||||
|
||||
Currently the project relies on Rust Nightly to build due to a requirement in
|
||||
|
@ -1,5 +0,0 @@
|
||||
server {
|
||||
root /var/www/clippable;
|
||||
index index.html;
|
||||
server_name clippable.shockrah.xyz;
|
||||
}
|
@ -74,22 +74,20 @@ function category_ready_handler(e?: Event) : Event {
|
||||
if(document.readyState != 'complete') { return e }
|
||||
|
||||
let xml = new XMLHttpRequest()
|
||||
const endpoint = window.location.origin + '/api' + window.location.pathname
|
||||
xml.open('GET', endpoint, false)
|
||||
xml.send()
|
||||
|
||||
if(xml.getResponseHeader('Content-Type') == 'application/json') {
|
||||
let raw = JSON.parse(xml.responseText)
|
||||
console.log(raw)
|
||||
for(const cat_raw of raw) {
|
||||
let cat = new VideoMeta(cat_raw)
|
||||
cat.as_div()
|
||||
console.log(cat)
|
||||
xml.onload = function() {
|
||||
if(this.getResponseHeader('Content-Type') == 'application/json') {
|
||||
let raw = JSON.parse(this.responseText)
|
||||
for(const cat_raw of raw) {
|
||||
let cat = new VideoMeta(cat_raw)
|
||||
cat.as_div()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(xml.getResponseHeader('Content-Type'))
|
||||
}
|
||||
|
||||
const endpoint = window.location.origin + '/api' + window.location.pathname
|
||||
xml.open('GET', endpoint, true)
|
||||
xml.send()
|
||||
|
||||
return e
|
||||
}
|
||||
|
22
ts/index.ts
22
ts/index.ts
@ -78,18 +78,20 @@ function ready_handler(e?: Event) : Event {
|
||||
const endpoint = window.location.origin + '/api/categories'
|
||||
let xml = new XMLHttpRequest()
|
||||
|
||||
// TODO: change this to an async request
|
||||
xml.open('GET', endpoint, false) // sync request
|
||||
xml.send(null) // nothing required for stuff
|
||||
if(xml.getResponseHeader('Content-Type') == 'application/json') {
|
||||
let raw = JSON.parse(xml.responseText)
|
||||
for(const cat_raw of raw) {
|
||||
let cat = new Category(cat_raw)
|
||||
cat.as_div()
|
||||
xml.onload = function() {
|
||||
if(this.getResponseHeader('Content-Type') == 'application/json') {
|
||||
let raw = JSON.parse(this.responseText)
|
||||
for(const cat_raw of raw) {
|
||||
let cat = new Category(cat_raw)
|
||||
cat.as_div()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log(xml.getResponseHeader('Content-Type'))
|
||||
}
|
||||
|
||||
// Fire request
|
||||
xml.open('GET', endpoint, true) // sync request
|
||||
xml.send(null) // nothing required for stuff
|
||||
|
||||
return e
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user