Error:
Error 404 The requested route was not found. Please refer to the API docs and try again.
Type
general_route_not_found
Details:
"dependencies": {
"cors": "^2.8.5",
"express": "^4.18.3",
"node-appwrite": "^12.0.0"
}
code:
const token = await users.createToken("3423FFR23R23R2R3");
const endPoint = "https://cloud.appwrite.io/v1"; // my endpoint
Description: i am getting "general_route_not_found" when i use createToken at node js side. i can able to perfoem other methods like create etc. but when i use "createToke " getting this error please let me know if anyone have solution.
I appreciate any help you can provide.
general_route_not_found
general_route_not_found (NODE JS)
Could you share your code?
Yes wait
Make sure to not send any API keys or sensitive info.
// index.js ( main file) this the end points where i sending request to create a token `app.post("/test-auth", async (req, res) => { console.log("req.body: ", req.body); try { const token = await users.createToken("3423FFR23R23R2R3"); const secret = token.secret;
res.json({ token: secret });
} catch (error) { console.log("err: ", error); res.json({ err: error.response, }); } });`
// setup.js
`import sdk from "node-appwrite";
const endPoint = "https://cloud.appwrite.io/v1"; const projectID = "PROJECT_ID"; const apiKey = "API_KEY;
const client = new sdk.Client() .setEndpoint(endPoint) // Your API Endpoint .setProject(projectID) // Your project ID .setKey(apiKey) // Your secret API key .setSelfSigned();
export let users = new sdk.Users(client);
export default client;`
@Faye here's the code.
Use 3 backticks like markdown next time and put your code in that, so it looks like this: 3 at top
code
3 at bottom
why do you have .setselfsigned()?
https://github.com/appwrite/sdk-for-node/blob/main/README.md
In this docs they mention
.setSelfSigned() // Use only on dev mode with a self-signed SSL cert
Thanks will keep this in mind 🙂
Recommended threads
- dynamic key missing scopes for database ...
Here are the scopes listed, I get permission errors for reading row and document. Appears to be missing since last time i checked. Database 6 Scopes policies....
- Selfhost - Starting Docker containers fa...
I am stuck at installing appwrite. Specifically, the containers dont want to start up. The images are downloaded and ready. Dockhand is reporting containers st...
- It says domain already used but I have d...
I accidentally deleted the project in which I used my domain originally (orexia.app) from name.com. Now I am trying to add it to a different project and it says...