Just thought I’d share this. My colleague made an awesome demo of a Ghost (as a headless CMS) site and created a weekly newsletter to keep readers up-to-date.
Just thought I’d share :)
Just thought I’d share this. My colleague made an awesome demo of a Ghost (as a headless CMS) site and created a weekly newsletter to keep readers up-to-date.
Just thought I’d share :)
It was really awesome… Thanks @NatePDThompson
Hey @NatePDThompson Thanks for this amazing tutorial. Got a few questions though, I think they’re easy questions, you’ ll realize i am a beginner. Hope you can answer them! Thanks in advanced!
On your tutorial you limit the iteration to 2 stories. We can see it here:
On the same file, (nl-stories-email.hbs) since you are using “published_at desc” i guess that means users will get only the latest post with the tag: nl-story. Is that correct?
When you mention you used Cerberus, to design the emails, does that means you used Cerberus for the code inside the email.hbs file? Or did you used it elsewhere? if so? where did you use Cerberus? No need for npm here, right?
4.On your tutorial you mention “hitting the create button” of the Lamda function on AWS, after a few instructions but you don’t mention to anything about selecting the Create New API and then selecting a security mechanism for the API endpoint, i assumed this is what you meant:
4.1 When you state: “We will not need the DynamoDB persmission that the default template requires.” Do you just mean us to ignore the default template AWS gives (a template on an index.js file) when creating the Lamda function?
4.2. When you briefly mention the “environment variables for some settings” are you talking about these three only?:
SENDGRID_API_KEY
GHOST_HOST
GHOST_CONTENT_KEY
4.3 Is the key for GHOST_HOST env variable the domain name? Or what is the key for that variable?
Well those are my only questions!! Sorry for the trouble but i am kind of new at this and some times have a little trouble filling the gaps on web dev instructions. And THANK YOU again for your tutorial!
Hey Luis,
I’m really glad you are giving it a shot!
Here are the answers to your questions
When running this code -which requires the Ghost admin-api- , on AWS Lambda:
I get this error:
{
"errorMessage": "Cannot read property 'split' of undefined",
"errorType": "TypeError",
"stackTrace": [
"token (/var/task/node_modules/@tryghost/admin-api/lib/token.js:4:30)",
"makeApiRequest (/var/task/node_modules/@tryghost/admin-api/lib/index.js:285:37)",
"makeResourceRequest (/var/task/node_modules/@tryghost/admin-api/lib/index.js:245:16)",
"Object.browse (/var/task/node_modules/@tryghost/admin-api/lib/index.js:127:20)",
"handler (/var/task/index.js:15:47)"
]
}
I shipped the code to AWS Lambda using Node.js 8.16 and the runtime over there (on Lambda) is Node.js 8.10
Does that matters?
Thanks in advanced.
I was reading the admin-api docs and it says that:
But on the Enviromental variables on my Lambda function i have:
GHOST_HOST pointing to > https://mydomain.com
I guess thats just wrong then right?
The GHOST_HOST variable on this scenario should point to:
https://mydomain.com/admin/ghost/api/2.25.9/admin
is that correct? …anyone?
Turns out i did not had any GHOST_ADMIN_KEY declared as env variable at all on the AWS Lambda panel.