nix/module: fix spaceapi endpoint
This commit is contained in:
parent
7bf2c31db3
commit
4890a0af04
|
@ -198,10 +198,6 @@ in
|
||||||
fastcgi_pass unix:${config.services.phpfpm.pools."pvv-nettsiden".socket};
|
fastcgi_pass unix:${config.services.phpfpm.pools."pvv-nettsiden".socket};
|
||||||
'';
|
'';
|
||||||
|
|
||||||
"= /spaceapi.php".extraConfig = ''
|
|
||||||
add_header Content-Type application/json;
|
|
||||||
'';
|
|
||||||
|
|
||||||
# based on https://simplesamlphp.org/docs/stable/simplesamlphp-install.html#configuring-nginx
|
# based on https://simplesamlphp.org/docs/stable/simplesamlphp-install.html#configuring-nginx
|
||||||
"^~ /simplesaml/" = {
|
"^~ /simplesaml/" = {
|
||||||
alias = "${finalPackage}/${finalPackage.passthru.simplesamlphpPath}/public/";
|
alias = "${finalPackage}/${finalPackage.passthru.simplesamlphpPath}/public/";
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
require_once dirname(__DIR__) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
require_once dirname(__DIR__) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
||||||
|
|
||||||
|
header('Content-Type: application/json');
|
||||||
|
header('Access-Control-Allow-Origin: *');
|
||||||
|
|
||||||
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
$pdo = new \PDO($DB_DSN, $DB_USER, $DB_PASS);
|
||||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
|
|
||||||
|
@ -39,7 +42,7 @@ $doorEntry = (object)($door->getCurrent());
|
||||||
"feeds": {
|
"feeds": {
|
||||||
"wiki": {
|
"wiki": {
|
||||||
"type": "atom",
|
"type": "atom",
|
||||||
"url": "https://www.pvv.ntnu.no/w/api.php?hidebots=1&urlversion=1&action=feedrecentchanges&feedformat=atom"
|
"url": "https://wiki.pvv.ntnu.no/w/api.php?hidebots=1&urlversion=1&action=feedrecentchanges&feedformat=atom"
|
||||||
},
|
},
|
||||||
"calendar": {
|
"calendar": {
|
||||||
"type": "html",
|
"type": "html",
|
||||||
|
|
Loading…
Reference in New Issue