Skip to content

Instantly share code, notes, and snippets.

View brense's full-sized avatar

Rense Bakker brense

View GitHub Profile
<?php
namespace application\commands;
use application\models\Request as Request;
abstract class AbstractCommand {
public function __construct(){}
<?php
$service = new Service();
$clientResource = new Resource('/client', new Client(), new ClientController);
$clientResource->addCustomRoute('GET', '/find', array(new ClientController, 'find'), array('name'));
$service->addResource($clientResource);
$request = Request::current();
$request->setBootstrapPath('/service'); // e.g. when the full path is http://www.mydomain.com/service
$response = $service->resolve($request);
@brense
brense / NSApi.ts
Last active April 12, 2023 11:38
Travel assistent project i've been working on recently
import fetch from 'node-fetch'
import Trip from '../customTypes/Trip'
import Station, { StationType } from '../customTypes/Station'
import moment from 'moment'
const { NS_API_PRIMARY_KEY } = process.env
const headers = { ['Ocp-Apim-Subscription-Key' as string]: NS_API_PRIMARY_KEY || '' }
const apiUrl = 'https://gateway.apiportal.ns.nl'