Option 2: Designing a Feed in Typescript
If you are more comfortable with a text editor, it can be helpful to use language-server TypeScript features to configure feed inputs. For the following demonstration, we'll use bun.sh for its ease of use with TypeScript.
Initialising the Project
Create the example directory and navigate to it to initialise the bun project:
# create the example directory mkdir example cd example # initialise the bun project bun initThe only dependency you'll need is the Switchboard On-Demand package,
@switchboard-xyz/on-demand. Install it with:bun add @switchboard-xyz/on-demandMake sure everything is installed correctly:
bun run index.ts # Hello via Bun!
Boilerplate Script
Many developers using Switchboard choose to use Visual Studio Code, this is a great tool for writing Typescript code and makes working with Oracle Jobs pretty straightforward.
To get started, replace the contents of index.tswith the following:
index.ts
Note: The simulation server is heavily rate-limited. Therefore, the endpoint should be used solely for test development purposes.
Running the Feed
From here, running the example feed is as simple as running:
This command should now output something similar to:
Last updated