git.ntnlv.ca
Repositories
Help
Report an Issue
qdmtl-ts.git
Code
Commits
Branches
Tags
Search
Tree:
dc4c229
Branches
Tags
prod
qdmtl-ts.git
endpoint.php
Adding CORS control
davvalent
commited
dc4c229
at 2023-03-05 05:04:15
endpoint.php
Blame
History
Raw
<?php require 'parse-ini.php'; require 'vendor/autoload.php'; $config = array( 'db_host' => 'localhost', 'db_name' => $infos['db_name'], 'db_user' => $infos['db_user'], 'db_pwd' => $infos['db_pwd'], 'store_name' => $infos['store_name'], 'max_errors' => 25, /* endpoint */ 'endpoint_features' => array( 'select', 'construct', 'ask', 'describe' // 'load', // 'insert', // 'delete' ), 'endpoint_timeout' => 60, // 'endpoint_read_key' => '', /* optional */ // 'endpoint_write_key' => '', /* optional, but without one, everyone can write! */ // 'endpoint_max_limit' => 250, /* optional */ ); // Cross-origin resource sharing (CORS) header("Access-Control-Allow-Origin: https://ntnlv.ca"); $ep = ARC2::getStoreEndpoint($config); try { if (!$ep->isSetUp()) { $ep->setUp(); } $ep->go(); } catch (Exception $e) { exit('Une erreur est survenue.'); } ?>