我有一个新手 Directus 问题:
\n我尝试跟随文档但徒劳:
\nnpm init directus-project example-projectcd example-project; npx directus starthttp://0.0.0.0:8055/admin/contentcd ..,离开我的 directus 项目,npm init directus-extension/到/hellosrc/index中cd demo-directus-endpoint; npm run buildhttps://docs.directus.io/extensions/creating-extensions/
\nTo 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.\nRun Code Online (Sandbox Code Playgroud)\ncd ../example-projectmkdir ./extensions/endpoints/democp -R ../demo-directus-endpoint/dist/index.js ./extensions/endpoints/demoindex.js 看起来像这样:
\n"use strict";module.exports=e=>{e.get("/hello",((e,l)=>l.send("Hello, World!")))};
npx directus start17:43:40 \xe2\x9c\xa8 Loaded extensions: demo\n17:43:40 \xe2\x9a\xa0\xef\xb8\x8f PUBLIC_URL should be a full URL\n17:43:40 \xe2\x9a\xa0\xef\xb8\x8f Spatialite isn\'t installed. Geometry type support will be limited.\n17:43:40 \xe2\x9c\xa8 Server started at http://0.0.0.0:8055\nRun Code Online (Sandbox Code Playgroud)\nhttp://0.0.0.0:8055/hellocurl http://0.0.0.0:8055/hello=>{"errors":[{"message":"Route /hello doesn\'t exist.","extensions":{"code":"ROUTE_NOT_FOUND"}}]}
17:43:55 \xe2\x9c\xa8 request completed GET 404 /hello 8ms\nRun Code Online (Sandbox Code Playgroud)\n怎样做才能得到Hello, World!什么时候curl http://0.0.0.0:8055/hello?
感谢您的帮助
\n