Welcome to the companion repository for the course "WebDon at HEIG-VD"! This course is designed to explain & showcase how to use the Notion API with PHP on the Webmardi database.
- PHP
- Composer
- Sample #1 - Fetching all events
- Sample #2 - Fetching all past events
- Sample #3 - Fetching all future events
- Sample #4 - Fetching the next event
- Sample #5 - Fetching one event
All samples are easily testable in your browser by running the php built-in web server.
php -S localhost:9000 -t samples/
And then browsing to the host and port you specified (in the above example, http://localhost:9000
).
- Install the dependencies with Composer:
$ composer install
- Copy the
.env.example
file in the examples folder as.env
$ cp ./.env.example ./.env
-
Fill the
.env
file with correct informationNOTION_WEBMARDI_DATABASE_ID
a Notion databaseNOTION_TOKEN
a valid notion Token for the previous Database
-
Run the PHP built-in web server. Supply the
-t
option to this directory:
$ php -S localhost:9000 -t ./