I have a service in another file that I'm includin...
# help
l
I have a service in another file that I'm including in my lambda handler. Reloading for live lambda only works when I make changes to the handler file, not the files its including. Is there any way to make it watch for changes on more files?
r
@Ross Gerbasi was seeing the same thing earlier.
r
We just solved this, are you setting
srcPath
on your api?
l
@Ross Gerbasi I am, but thats the path to my handler right? My code structure is like core/bussiness logic and services/handlers. Inside handlers i include code from core dir, but when I make changes to that part of the app, I have to restart the service manually
@Ross Coundon Was it solved?
r
not sure if you're asking me or the other Ross but yes we solved this
the problem is
srcPath
if you set it the watched will only watch files within the
srcPath
root directory
so for your api routes you want to make sure to specific the full path to your route file. for example
/src/api/myroute.ts
l
ahh, so I shouldn't use srcPath, and specify the full path for each handler?
r
yes. that was the mistake i made as well. i was using
srcPAth
to try to simplify my route paths
l
Yeah, same. Thanks
r
but the recommendation is to simply make something like
const basePath = '/src/api'
and concat in your routes
l
Tbh, thats what I thought
srcPath
does
r
me too haha
I have been coding for weeks by swapping back to my one file and refreshing... very happy to have it solved now.
l
I've been just restarting live lambda service each time I make changes to the other file...
r
oh wow, yeah well its much better now 🙂
l
Yeah, thanks a lot
r
It's fun to confuse people by pointing people to a different Ross for help 😄
f
haha I’ve definitely done that too. Slack needs to be smarter… @thdxr is irrelevant in this thread.. or was 😅