<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Directus 9 : sample NodeJS scripts?]]></title><description><![CDATA[<p dir="auto">I'm developing a small app for a society.<br />
Currently favouring Budibase because it has front-end and back-end and app designer.<br />
But keen to explore how Directus could handle the same project.</p>
<p dir="auto">Installed custom Directus 9 as a Cloudron app (thanks to @atrilahiji)<br />
I'll think about front-end for Directus app later.<br />
Fo now I want to prove out the storing and retrieval of data in/from Directus.</p>
<p dir="auto">But not finding any suitable example NodeJS scripts.<br />
Yes, I have read Directus Docs. But no 'tutorial' for noobs like me.<br />
Does anyone have any pointers ?</p>
]]></description><link>https://forum.cloudron.io/topic/4865/directus-9-sample-nodejs-scripts</link><generator>RSS for Node</generator><lastBuildDate>Mon, 20 Apr 2026 10:25:20 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/4865.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 Apr 2021 12:07:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Directus 9 : sample NodeJS scripts? on Sat, 10 Apr 2021 18:24:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/timconsidine" aria-label="Profile: timconsidine">@<bdi>timconsidine</bdi></a> ah so you’re working on auth. I haven’t done any auth stuff in there yet but I can give it a shot at some point here. As for that script, idk I haven’t used their SDK ever. My use case involved publicly readable data so I just make a basic get request to there using the axios library</p>
]]></description><link>https://forum.cloudron.io/post/29524</link><guid isPermaLink="true">https://forum.cloudron.io/post/29524</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Sat, 10 Apr 2021 18:24:23 GMT</pubDate></item><item><title><![CDATA[Reply to Directus 9 : sample NodeJS scripts? on Sat, 10 Apr 2021 17:36:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/timconsidine" aria-label="Profile: timconsidine">@<bdi>timconsidine</bdi></a> ah, let's see what <a class="plugin-mentions-user plugin-mentions-a" href="/user/marcusquinn" aria-label="Profile: marcusquinn">@<bdi>marcusquinn</bdi></a> thinks about that, as he's been using EspoCRM for similar things.</p>
]]></description><link>https://forum.cloudron.io/post/29522</link><guid isPermaLink="true">https://forum.cloudron.io/post/29522</guid><dc:creator><![CDATA[robi]]></dc:creator><pubDate>Sat, 10 Apr 2021 17:36:07 GMT</pubDate></item><item><title><![CDATA[Reply to Directus 9 : sample NodeJS scripts? on Sat, 10 Apr 2021 14:01:38 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/robi" aria-label="Profile: robi">@<bdi>robi</bdi></a> At this stage, I'm just scaffolding a simple command line CRUD script to prove connection to the hosted Directus.</p>
<p dir="auto">I've managed to craft a bare-bones script for create and read (in case it helps any other noob).</p>
<pre><code>import { Directus } from '@directus/sdk';
const directus = new Directus('https://domain/');
await directus.auth.static('static_token');

const test = directus.items('test');
await test.createOne({
    status: 'draft',
    name: 'Jo',
    age: 20,
    points: 5,
});

const tests = await directus.items('test').readMany();
console.log({
    items: tests.data,
//      total: tests.meta.total_count,
});
</code></pre>
<p dir="auto">The  "total: tests.meta.total_count" is straight from web docs, but doesn't work, so investigating.  Probably my error as usual.</p>
<p dir="auto">So now I know calls to Directus work fairly easy.<br />
I guess where my knowledge is failing (apart from this being the very first Node script I've done) is linking CRUD functions to a front-end.  But I will keep looking.</p>
<p dir="auto">The intended app is also v.simple.</p>
<ul>
<li>Users self-register</li>
<li>Users login</li>
<li>User then views available events</li>
<li>User registers for event and buys tickets to event (probably handle that through a Stripe call)</li>
<li>Email ticket confirmation and receipt to user</li>
<li>User can reset their password</li>
</ul>
<p dir="auto">I guess I will figure out, just always prefer to use a library or framework for the heavy lifting and reduce scope for errors in my DIY coding.</p>
]]></description><link>https://forum.cloudron.io/post/29520</link><guid isPermaLink="true">https://forum.cloudron.io/post/29520</guid><dc:creator><![CDATA[timconsidine]]></dc:creator><pubDate>Sat, 10 Apr 2021 14:01:38 GMT</pubDate></item><item><title><![CDATA[Reply to Directus 9 : sample NodeJS scripts? on Sat, 10 Apr 2021 13:40:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/timconsidine" aria-label="Profile: timconsidine">@<bdi>timconsidine</bdi></a> can you describe what you're trying to do, in terms of the app?</p>
]]></description><link>https://forum.cloudron.io/post/29519</link><guid isPermaLink="true">https://forum.cloudron.io/post/29519</guid><dc:creator><![CDATA[robi]]></dc:creator><pubDate>Sat, 10 Apr 2021 13:40:45 GMT</pubDate></item></channel></rss>