CLI Tool MVP Finished
Today I will try and fix the media links.
I fixed the issue, it was to do with the nginx config. I had forgotten the root directive.
location / { root /usr/share/nginx/html; autoindex on; try_files $uri $uri/ =404; }
I need to remember to disable the autoindex in production 🙂
I have a problem with creating entries from the cli. I need a projectId, but only have the project slug. I'll have to fetch the productIds or something so I can match them against the slug. Not sure what the best approach is.
Thought about different approaches, and I think I've figured out the best way to approach this. Here's what I decided to do:
I'm going to add a new endpoint
GET /users/info
which will return all users' info and projects. I will store that info somewhere (have to look that up) and use it in subsequent requests. That will also allow me to validate input before even sending the http request.
I added a call to this on every submit request. Ideally, I would support a command that lets me pass in my token once and store it so I don't have to repeat it. Not sure if having a cli tool rely on state is a good idea. I'll have to think about that. Right now, this simple approach is working, so I'll leave it at that.
And that's the full CLI MVP feature complete. It's kinda rough, but it works.