The setup installs the following software:
The setup installs the following software:
- Apache
- MySQL
- PHP
- Node
| <?php | |
| /** | |
| * by setting the regex condition for the :method param to '.+', it matches | |
| * everything, including "/" chars. this lets us match any URL of the format. | |
| * | |
| * /api/foo outputs "foo" | |
| * /api/foo/bar/baz outputs "foo/bar/baz" | |
| */ | |
| $app->get('/api/:method', function($method) use ($app) { | |
| echo $method; |
| <?php | |
| /** | |
| * by setting the regex condition for the :method param to '.+', it matches | |
| * everything, including "/" chars. this lets us match any URL of the format. | |
| * | |
| * /api/foo outputs "foo" | |
| * /api/foo/bar/baz outputs "foo/bar/baz" | |
| */ | |
| $app->get('/api/:method', function($method) use ($app) { | |
| echo $method; |
| -- Create a group | |
| CREATE ROLE readaccess; | |
| -- Grant access to existing tables | |
| GRANT USAGE ON SCHEMA public TO readaccess; | |
| GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess; | |
| -- Grant access to future tables | |
| ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess; |
| //install dev vesrion of google chrome form https://www.chromium.org/getting-involved/dev-channel | |
| //install chrome-remote-interface from npm npm install chrome-remote-interface | |
| const CDP = require('chrome-remote-interface'); | |
| CDP((protocol) => { | |
| const {Page, Runtime} = protocol; | |
| // First, need to enable the domains we're going to use. | |
| Promise.all([ | |
| Page.enable(), |