faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
_whitelogger has joined #amber
<FromGitter> <andrewc910> How do you configure amber to accept more origins?
<FromGitter> <andrewc910> Running amber in api mode and react app can't post data because of some origin issue.
<FromGitter> <drujensen> I thought we fixed that. Set an origin header will fix it or disable the CORS pipe.
<FromGitter> <andrewc910> GET requests are fine. I am just testing with a 'Pets' model. ⏎ ⏎ My index page can get all pets but when i click delete, i get a 403 error. Here are the headers set by axios: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5f95b70aa0a3072b43a49e56]
<FromGitter> <andrewc910> Ambers on 3001, react is on 3000
<FromGitter> <andrewc910> And disabling the cors pipeline causes all requests to fail?
<FromGitter> <drujensen> Ok. This is different. Check the CORS handler code. You should be able to specify the pattern to match your accepted origins. I think it is related to specifying a port. I don’t think that was coded for.
<FromGitter> <andrewc910> Strange. I put a few `puts` in Amber::Pipe::Cors#put_response_headers. ⏎ ⏎ This is what amber logged: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5f95ba0dbbffc02b583c427b]
<FromGitter> <andrewc910> It looks like it's allowing it?
<FromGitter> <andrewc910> So disabling cors does give a 200 server side but then the browser blocks it.
<FromGitter> <andrewc910> I got it working. It was nothing to do with amber. IDK what was making amber throw a 403 forbidden but i was using axios wrong. Apparently i need to include the id in the url & in an obj as a second argument.
<FromGitter> <andrewc910> Thanks for the help though :)
<FromGitter> <Orijhins> Hello and sorry if that question was already answered, but does Amber auto-generates the created/updated timestamps? Using amber generate ... doesn't include these
<FromGitter> <drujensen> It will for MySQL and pg.
<FromGitter> <drujensen> It’s been years since I checked but I recall SQLite didn’t support times.
<FromGitter> <Orijhins> Right, thank you !