location /static/ {
root /etc;
autoindex off;
}
# IMGProxy
# location /teaser {
# proxy_pass http://imgproxy:8080;
# }
/home/romaro/gp/files/test.txt
- type: bind
source: /home/romaro/gp/files
target: /etc/static
location /static {
root /etc;
}
gp-nginx | 10.0.2.2 - - [08/Jul/2022:07:50:34 +0000] "GET / HTTP/1.1" 404 146 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
gp-nginx | 10.0.2.2 - - [08/Jul/2022:07:50:41 +0000] "GET /static HTTP/1.1" 404 146 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
gp-nginx | 10.0.2.2 - - [08/Jul/2022:07:50:52 +0000] "GET /static/test.txt HTTP/1.1" 404 146 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
This might feel a bit cumbersome at first, but TypeScript tooling like auto-imports and path completion will typically just do this for you.
abstract class AUri {}
type ConstrUri = new() => AUri;
class Uri extends AUri {
get index() { return '/'}
}
abstract class AController<T> {
public urls: T;
constructor(c: T) {
this.urls = c;
}
}
class Controller extends AController<Uri> {
constructor() {
super(new Uri);
}
}
const c = new Controller;
console.log(c.urls.index);
abstract class PageServ {
abstract templateName: string;
abstract httpStatus: number;
constructor() {
}
get template(): string {
return this.templateName + '.html';
}
}
const MainPageServ = class extends PageServ {
public templateName: string;
public httpStatus: number;
constructor() {
super();
this.templateName = 'MainPage';
this.httpStatus = 200;
}
}
function fabric(Page: new () => PageServ) {
const inst = new Page;
console.log(inst.httpStatus);
}
fabric(MainPageServ);
Но здесь есть проблема: тайпскрипт не выдаст ошибки, если я забуду реализовать указанные поля в дочернем классе.
abstract class PageServ {
abstract templateName: string;
abstract httpStatus: number;
constructor() {
}
get template(): string {
return this.templateName + '.html';
}
}
abstract class PageServ {
declare public templateName: string;
declare public httpStatus: number;
constructor() {
}
get template(): string {
return this.templateName + '.html';
}
}
class MainPageServ extends PageServ{
constructor() {
super();
this.templateName = 'MainPage';
this.httpStatus = 200;
}
}
const page = new MainPageServ;
console.log(page.httpStatus);
Затем, когда я сослался на Overpass Mono, браузер его просто не нашел, т.к. не было ссылок на загрузку шрифтов с таким семейством и применил второе по приоритету.