<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
| echo '[Unit] | |
| Description=High-performance, schema-free document-oriented database | |
| After=syslog.target network.target | |
| [Service] | |
| User=mongodb | |
| Group=mongodb | |
| ExecStart=/usr/bin/mongod -f /etc/mongod.conf | |
| [Install] |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| const fastify = require('fastify')(); | |
| fastify.get('/', (request, reply) => reply.send({ hello: 'world' })); | |
| if (require.main === module) { | |
| // called directly i.e. "node app" | |
| fastify.listen(3000, (err) => { | |
| if (err) console.error(err); | |
| console.log(`server listening on ${fastify.server.address().port}`); | |
| }); |
| var db = mongoose.connect('mongodb://localhost:27017/DB'); | |
| // In middleware | |
| app.use(function (req, res, next) { | |
| // action after response | |
| var afterResponse = function() { | |
| logger.info({req: req}, "End request"); | |
| // any other clean ups |
| #include "v8.h" | |
| #include "helpers.h" | |
| #include <iostream> | |
| using v8::Local; | |
| using v8::String; | |
| using v8::Array; | |
| void PrintLocalString(v8::Local<v8::String> key){ |
| #user nobody; | |
| #Defines which Linux system user will own and run the Nginx server | |
| worker_processes 1; | |
| #Referes to single threaded process. Generally set to be equal to the number of CPUs or cores. | |
| #error_log logs/error.log; #error_log logs/error.log notice; | |
| #Specifies the file where server logs. |
| for i in `ls *.svg` | |
| rsvg-convert -f pdf -o PDF/${i}.pdf $i |
A quick overview of the node.js streams interface with basic examples.
This is based on @brycebaril's presentation, Node.js Streams2 Demystified
Streams are a first-class construct in Node.js for handling data.
Think of them as as lazy evaluation applied to data.