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
- The current user is not authorized to pe...
I want to create a document associated with user after log in with OAuth. The user were logged in, but Appwrite said user is unauthorized. User is logged in wi...
- self-hosted auth: /v1/account 404 on saf...
Project created in React/Next.js, Appwrite version 1.6.0. Authentication works in all browsers except Safari (ios), where an attempt to connect to {endpoint}/v1...
- My account is blocked so please check an...
My account is blocked so please unblock my account because all the apps are closed due to which it is causing a lot of problems