https://vercel.com/guides/session-store-nextjs-redis-vercel-kv
Unanswered
American Kestrel posted this in #help-forum
American KestrelOP
https://vercel.com/guides/session-store-nextjs-redis-vercel-kv
In this link, all the code that's given, except for the last block, where do I add it? the functions for getSessionId, setSessionId, get, getAll, set, etc.
I have a next.js 13.4 repo
Should I add it in my api/<whatever>/route.ts?
In this link, all the code that's given, except for the last block, where do I add it? the functions for getSessionId, setSessionId, get, getAll, set, etc.
I have a next.js 13.4 repo
Should I add it in my api/<whatever>/route.ts?
11 Replies
tafutada777
i guess you can define them in ./session-store file. 1, 2 3 can sit in the same file i guess.
so you can grab them
import { get, set, getSessionId } from './session-store';
import { get, set, getSessionId } from './session-store';
obviously it accesses cookie and kv, so it works in server side codes only. it does not work in client side codes.
American KestrelOP
Oh! Ok!
American KestrelOP
Hi, another doubt
this happens
when I've cleared commented it out
tafutada777
u need to specify http part. like https://www.something.com/api/youtube
American KestrelOP
but what if we're running locally
tafutada777
http://localhost/api/youtube
but calling yourself is not recommended.
but calling yourself is not recommended.
American KestrelOP
If I want to make two separate API calls to POST under api/youtube
how can I do that?
should I just make two different folders
api/youtube1
api/youtube2
how can I do that?
should I just make two different folders
api/youtube1
api/youtube2