Glancer_TestsetPageID.ts1 match
6});
78export async function setPageID(data: any) {
9try {
10const page = await notion.pages.update({
Glancer_TestsetPageIcon.ts1 match
6});
78export async function setPageIcon(id: string, iconURL: string) {
9try {
10const page = await notion.pages.update({
Glancer_TestsetDemoURL.ts1 match
6});
78export async function setDemoURL(id: string, url: string) {
9try {
10const page = await notion.pages.update({
Glancer_TestsetCobrowse.ts1 match
6});
78export async function setCobrowse(id: string, cobrowse: boolean) {
9try {
10const page = await notion.pages.update({
Glancer_TestsetAction.ts1 match
6});
78export async function setAction(data: any) {
9try {
10const page = await notion.pages.create({
Glancer_TestrecordClick.ts1 match
1export async function recordClick(action: string) {
2// Create data to store
3const clickData = {
Glancer_TestREADME.md6 matches
86```typescript
87// Client-side event recording
88window.recordClick = function (action) {
89fetch(`/api/setAction`, {
90method: "POST",
116│ └── index.tsx # Frontend JavaScript entry point
117└── shared/ # Utilities used by both frontend and backend
118└── utils/ # Shared helper functions
119```
120129### Shared (`/shared`)
130131Contains utilities and functions that work in both browser and server environments, ensuring code reusability across the application.
132133## Framework and Technology Stack
189### Shared Utilities (`/shared`)
190191Contains helper functions that work in both frontend and backend environments:
192193```typescript
220221```typescript
222export default async function (interval: Interval) {
223const pages = await notion.databases.query({
224database_id: Deno.env.get("GLANCE_DEMOS_DB_ID"),
280| Aspect | Controller | Utility |
281| ------------ | --------------------------------------------- | ------------------------------------------------- |
282| Purpose | Orchestrates business logic and workflows | Provides small, stateless helper functions |
283| Scope | High-level, involves services or side effects | Low-level, narrow focus (string, date operations) |
284| State | Works with application or user-specific data | Stateless - input in, output out |
Glancer_TestREADME.md1 match
6| Aspect | **Controller** | **Util** |
7| ----------------- | --------------------------------------------------- | --------------------------------------------------- |
8| **Purpose** | Orchestrates business logic and workflows | Provides small, stateless helper functions |
9| **Scope** | High-level, often involves services or side effects | Low-level, narrow in focus (e.g., string, date ops) |
10| **State** | Works with application or user-specific data | Stateless – input in, output out |
Glancer_TestREADME.md4 matches
7### Task endpoints use /controllers to get and save data
89In order to keep the API easy to look and work with, the routes in /tasks handle routing but do not get data from or save data to Notion. The functions that connect to Notion live in the /controllers directory, and are _called_ from the endpoints in /tasks.
1011### Naming convention for routes and controllers
25Note that the export in the controller follows the same convention; it's also called `setDemoURL`.
26271. Once the controller is imported, pass data to the exported function so that it can do its thing:
2829```
31```
3233Note the function call is the exported function in the import object at the top of the route; i.e., `{ setDemoURL }`. The `setDemoURL.ts` controller exports it like this:
3435```
36// /controllers/setDemoURL.ts
37export async function setDemoURL(data: any) {
38try {
39...
Glancer_TestREADME.md1 match
1This directory has crons that extract data from Notion and save that data to blob storage in val.town. Blob storage functions like a cache.
23## Caching keeps customer-facing /demos snappy