Skip to content

Instantly share code, notes, and snippets.

View robertz's full-sized avatar

Robert Zehnder robertz

View GitHub Profile
@robertz
robertz / api.js
Last active February 21, 2018 15:34
API method to support data table and paging
exports.getPaymentsVue = async (req, res) => {
const getPayees = () => {
return Payee.find({ owner: req.params.userid })
.cache(0, req.params.userid + "__payees")
.then(payees => {
return payees;
});
};
@robertz
robertz / payment.js
Created February 21, 2018 15:28
The new payment page
const app = new Vue({
el: "#app",
data: {
hasPayments: false,
payments: [],
payees: [],
pageSize: 10,
currentPage: 1,
prevEnable: false,
nextEnable: true,
@robertz
robertz / nuxt.config.js
Created February 24, 2018 02:05
Nuxt application config
module.exports = {
/*
** Router config
*/
router: {
middleware: "check-auth"
},
/*
** Headers of the page
*/
@robertz
robertz / index.js
Created February 24, 2018 02:12
serverMiddleware express handler
const express = require("express");
const bodyParser = require("body-parser");
const mongoose = require("mongoose");
const cors = require("cors");
const apiController = require("./controllers/api");
// Create express instnace
const app = express();
@robertz
robertz / api.js
Created February 24, 2018 02:15
Export the controller methods to support the app routes
const Payee = require("../models/Payee");
const Payments = require("../models/Payment");
exports.getPayees = async (req, res) => {
return Payee.find({ owner: req.params.userid })
.sort({ day: 1 })
.then(payees => {
res.json(payees);
});
};
version: '2'
services:
dev-nginx:
build:
context: ./.docker/dev/nginx
container_name: dev-nginx
links:
- dev-node
ports:
- "80:80"
version: '2'
services:
fullstack-nginx:
build:
context: ./.docker/prod/nginx
container_name: fullstack-nginx
links:
- fullstack-node
ports:
- "80:80"
@robertz
robertz / nginx.vh.default.conf
Last active April 10, 2018 23:33
Development nginx configuration
upstream backend {
server dev-node:3000;
}
upstream webpack {
server dev-webpack:8080;
}
server {
listen 80;
@robertz
robertz / nginx.vh.default.conf
Last active April 10, 2018 23:33
Production nginx config
upstream backend {
server fullstack-node:3000;
}
server {
listen 80;
server_name localhost;
#access_log /var/log/nginx/host.access.log main;
@robertz
robertz / .eslintrc.json
Created March 29, 2018 17:01 — forked from leny/.eslintrc.json
ESLint config file for node.js + ES6 projects.
{
"env": {
"node": true,
"es6": true
},
"ecmaFeatures": {
"arrowFunctions": true,
"blockBindings": true,
"classes": true,
"defaultParameters": true,