#Not getting response from appwrite

1 messages · Page 1 of 1 (latest)

bold ice
#

I was making a client
.setEndpoint('https://cloud.appwrite.io/v1')
and its not working showing this on clicking this link
Error 404
The requested route was not found. Please refer to the API docs and try again.
And while open the localhost/3000 getting this error
Unhandled Runtime Error

AppwriteException: Network request failed
Call Stack
AppwriteException
node_modules\appwrite\dist\esm\sdk.js (82:0)
call/<
node_modules\appwrite\dist\esm\sdk.js (404:0)
rejected
node_modules\appwrite\dist\esm\sdk.js (23:41)

modern viper
#

Can you show your entire code?

#

There are chances that the endpoints weren't set properly

bold ice
#

import { Client,Account,ID,Databases,Storage } from "appwrite";

const client = new Client();
client
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject('process.env.NEXT_PUBLIC_APPWRITE_PROJECT_ID');

const account = new Account(client)
const databases = new Databases(client)
const storage = new Storage(client)

export {client,account,databases,storage,ID}

#

This is appwrite file

#

export const getTodosGroupByColumn= async () =>{
const data = await databases.listDocuments(
process.env.NEXT_PUBLIC_DATABASE_ID!,
process.env.NEXT_PUBLIC_COLLECTION_ID!
)
const todos = data.documents

// try{
    const columns = todos.reduce((acc,todo)=>{
        if(!acc.get(todo.status)){
            acc.set(todo.status,{
                id: todo.status,
                todos:[]
            })
        }
        acc.get(todo.status)!.todos.push({
            $id : todo.$id,
            $createdAt:todo.$createdAt,
            title: todo.title,
            status:todo.status,
            //get image if exists on the todo
            ...(todo.image && {image:JSON.parse(todo.image)})
        })
        return acc
    },new Map<TypedColumn,Column>())
    
    console.log(columns)
// }catch (e){
//     console.error(e)
// }

}

modern viper
#

What are you trying to do?

bold ice
#

I made a database in appwrite and in that database there are todos in that there are mainly three main category according to those category things will filter out with the help of map

#

In chrome in console this is showing

modern viper
frank compass
#

@bold ice Are you self-hosting appwrite?