
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
humblebee-backend
Advanced tools
This is our backend boilerplate, made for serverless backends. It uses Serverless Framework and also has a CRUD API baseplate for Google Cloud Functions.
This is our backend boilerplate, made for serverless backends. It uses Serverless Framework and also has a CRUD API baseplate for Google Cloud Functions.
yarn deploy:ssr
: Deploy SSR build to server (assumes Google Cloud Platform/Firebase Hosting)yarn build:ssr
: Output a build optimized for server-side rendering (read below for implementation details)yarn deploy:serverless
: Deploy with Serverless
— yarn deploy:ssr
: Deploy SSR site with Google Cloud FunctionsWe can create fairly flat, universal web apps with the boilerplate. There are a few considerations and changes that need to be accounted for when building for SSR, since the boilerplate assumes client-side rendering (CSR) in a PWA format.
Note: It is recommended, for ease of development and reduction of headaches, that an early call is made on whether the application should be SSR or CSR.
The SSR implementation uses a streaming type of implementation which is very fast, but has certain issues with modules that are run in a ”standard” way, like React Helmet’s staticRender() that is done after the render.
Aliasing React to preact
or preact-compat
will currently break an SSR implementation. Make sure to un-alias in webpack.common.js
when building for SSR.
If you are aliasing/unaliasing React, make sure that any instances of Unistore and its components reference a React-specific package, rather than Preact versions.
This needs to be disabled for SSR. A solution may be to use react-universal
instead.
Our implementation assumes Google Cloud Functions and Firebase Hosting. This should be easily transferable to other vendors. Or just use the Serverless framework.
If you go with Google, make sure to setup your Google account to access the right stuff.
When using SSR, and especially when we are using a cloud function, we need to send the page content and headers down. The functions/index.js file includes template sections for headers, beginning and end of what is normally the index.html file.
It is recommended to do title and header handling in the server.js file instead of in React Helmet. Since react-helmet affects window it will break SSR.
app.get('**', (req, res) => {
const url = req.params[0].toLowerCase();
let title = '';
if (url === '/career') {
title = 'Humblebee – Career';
}
if (url === '/ourapproach') {
title = 'Humblebee – Our Approach';
} else {
title = 'Humblebee';
}
renderApplication(title, res);
});
From https://serverless.com/framework/docs/providers/google/guide/credentials/
You need to create credentials Serverless can use to create resources in your Project.
FAQs
This is our backend boilerplate, made for serverless backends. It uses Serverless Framework and also has a CRUD API baseplate for Google Cloud Functions.
We found that humblebee-backend demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.