I have a nooby Directus question :
I try to follow the doc in vain :
npm init directus-project example-project
cd example-project; npx directus start
http://0.0.0.0:8055/admin/content
cd ..
, going away of my directus project, npm init directus-extension
/
to /hello
in src/indexcd demo-directus-endpoint; npm run build
https://docs.directus.io/extensions/creating-extensions/
To deploy your extension, you have to move the output from the dist/ folder into your project's ./extensions/<extension-folder>/<extension-name>/ folder. <extension-folder> has to be replaced by the extension type in plural form (e.g. interfaces). <extension-name> should be replaced with the name of your extension.
cd ../example-project
mkdir ./extensions/endpoints/demo
cp -R ../demo-directus-endpoint/dist/index.js ./extensions/endpoints/demo
index.js looks like this :
"use strict";module.exports=e=>{e.get("/hello",((e,l)=>l.send("Hello, World!")))};
npx directus start
17:43:40 ✨ Loaded extensions: demo
17:43:40 ⚠️ PUBLIC_URL should be a full URL
17:43:40 ⚠️ Spatialite isn't installed. Geometry type support will be limited.
17:43:40 ✨ Server started at http://0.0.0.0:8055
http://0.0.0.0:8055/hello
curl http://0.0.0.0:8055/hello
=> {"errors":[{"message":"Route /hello doesn't exist.","extensions":{"code":"ROUTE_NOT_FOUND"}}]}
17:43:55 ✨ request completed GET 404 /hello 8ms
What to do in order to get Hello, World!
when curl http://0.0.0.0:8055/hello
?
Thank you for your help
Answer found curl http://0.0.0.0:8055/demo/hello => Hello, World!