I hereby claim:
- I am NickNaso on github.
- I am nicknaso (https://keybase.io/nicknaso) on keybase.
- I have a public key whose fingerprint is E4C8 FE7F 27F4 F780 4334 7978 39E9 BBA6 417F A66E
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| 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] |
| 'use strict' | |
| const express = require('express') | |
| const http = require('http') | |
| const app = express() | |
| function handleGet (req, res) { | |
| res.send('/GET handler') | |
| } |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| /******************************************************************************* | |
| * Copyright (c) 2017 Nicola Del Gobbo | |
| * Licensed under the Apache License, Version 2.0 (the "License"); you may not | |
| * use this file except in compliance with the License. You may obtain a copy of | |
| * the license at http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS | |
| * OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY | |
| * IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, | |
| * MERCHANTABLITY OR NON-INFRINGEMENT. |
| 'use strict' | |
| const express = require('express') | |
| const http = require('http') | |
| const app = express() | |
| ////////////////////////////////// ROUTER ///////////////////////////////////// | |
| const router = express.Router() |
| 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 |
| 'use strict' | |
| const mongoose = require('mongoose') | |
| mongoose.Promise = global.Promise | |
| function wait(time) { | |
| return new Promise((resolve) => { | |
| setTimeout(resolve, time) | |
| }) |