
Product
Unify Your Security Stack with Socket Basics
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
@mia-platform/lc39
Advanced tools
The Mia-Platform Node.js service launcher
lc39 is a Command line utility that will launch a Fastify instance configured for serving a Node.js service on Mia-Platform.
To install the package you can run:
npm install @mia-platform/lc39 --save
It is possible to install the next version of the package, which use fastify v3. The version is a release candidate, so it is not yet a stable version and should not be used in production environments (next updates could be breaking). To try it, you can run:
npm install @mia-platform/lc39@next --save
We recommend to install the module locally on every one of your project to be able to
update them indipendently one from the other. To use the locally installed instance you
have to add the following script to your package.json
:
"scripts": {
"start": "lc39 index.js"
},
To see all the options you can add to the cli run:
npx lc39 --help
Now you are ready to code your mia-platform service!
To work properly with lc39 your service main file should follow some rules:
v7.0.0 - 2023-05-11
In this version, is added the support for Fastify v4. To upgrade, read the migration guide.
Metrics options are changed. Below there are the main changes. For other configuration, see here.
enableDefaultMetrics: boolean
--> defaultMetrics: {enabled: boolean}
pluginName
--> name
enableRouteMetrics
--> routeMetrics.enabled: boolean
groupStatusCodes
--> routeMetrics.groupStatusCodes
invalidRouteGroup
--> invalidRouteGroup
(default changed from undefined to unknown)routeMetrics.overrides
blacklist
--> routeMetrics.routeBlacklist
prefix
--> defaultMetrics.prefix
node 14 and below are not supported. If you want to use this version of lc39, upgrade node to version 16 and above
Export lc39 as the main function exported by the package. This brings two big changes:
silent
by default: this because it is not used only for testsexported lc39 function remove the default log level set to silent, and it is now set to info. This is required since it is possible to configure lc39 also from function and not only from CLI
forceCloseConnections
is set to 'idle' from false in node 18. This means that idle requests are destroyed on server close
remove errorHandler option as unsupported by fastify-sensible
migrated @fastify/swagger
to v8
, so that @fastify/swagger-ui
package is now required to continue exposing Swagger UI
upgraded fastify plugins to support latest fastify version
upgraded library dependencies
when you handle streams when using async-await you will need to return or await the reply object:
fastify.get('/streams', async function (request, reply) {
const fs = require('fs')
const stream = fs.createReadStream('some-file', 'utf8')
reply.header('Content-Type', 'application/octet-stream')
return reply.send(stream)
})
error
FAQs
The Mia-Platform Node.js service launcher
The npm package @mia-platform/lc39 receives a total of 1,492 weekly downloads. As such, @mia-platform/lc39 popularity was classified as popular.
We found that @mia-platform/lc39 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.
Product
A single platform for static analysis, secrets detection, container scanning, and CVE checks—built on trusted open source tools, ready to run out of the box.
Product
Socket is launching experimental protection for the Hugging Face ecosystem, scanning for malware and malicious payload injections inside model files to prevent silent AI supply chain attacks.
Research
/Security News
The Socket Threat Research Team uncovered a coordinated campaign that floods the Chrome Web Store with 131 rebranded clones of a WhatsApp Web automation extension to spam Brazilian users.