This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": 2, | |
| "name": "to-be-or-not-to-be", | |
| "regions": ["bru1"], | |
| "builds": [ | |
| { "src": "/static/**", "use": "@now/static" }, | |
| { "src": "next.config.js", "use": "@now/next" } | |
| ], | |
| "routes": [ | |
| { "src": "/prijzen", "dest": "/pricing" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint-disable */ | |
| // Fix for: https://github.com/zeit/next.js/issues/5750#issuecomment-442313585 | |
| const { PHASE_PRODUCTION_SERVER } = | |
| process.env.NODE_ENV === 'development' | |
| ? {} | |
| : require('next-server/constants'); | |
| const config = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const withSass = require('@zeit/next-sass'); | |
| const config = { | |
| publicRuntimeConfig: { | |
| apiUrl: process.env.API_URL, | |
| mediaUrl: process.env.MEDIA_URL | |
| } | |
| }; | |
| module.exports = withSass(config); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('dotenv').config(); | |
| const http = require('http'); | |
| const url = require('url'); | |
| // import NOW SETTINGS | |
| const now = require('./now.json'); | |
| const PORT = process.env.PORT || 3030; | |
| const routes = now.routes.reduce((map, route) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A hook that logs service method before, after and error | |
| // See https://github.com/winstonjs/winston for documentation | |
| // about the logger. | |
| const logger = require('winston'); | |
| const timber = require('timber'); | |
| const transport = new timber.transports.HTTPS(process.env.TIMBER_KEY); | |
| timber.install(transport); | |
| // To see more detailed messages, uncomment the following line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // const { makeCallingParams } = require('feathers-hooks-common'); | |
| const BatchLoader = require('@feathers-plus/batch-loader'); | |
| const { getUniqueKeys, getResultsByKey } = BatchLoader; | |
| const QUERY = ` | |
| SELECT count("productId"), "productId" | |
| FROM "inventoryItems" | |
| WHERE "productId" = ANY (:productIds) | |
| GROUP BY "productId" | |
| `; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Can be run as a before and after hook | |
| const { alterItems } = require('feathers-hooks-common'); | |
| const slug = require('slug'); | |
| module.exports = function (fromField, toField = 'slug') { // eslint-disable-line no-unused-vars | |
| return alterItems(item => { | |
| if (!item[fromField]) | |
| throw new Error(`No such field [${fromField}]`); | |
| item[toField] = slug(item[fromField]); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Initialize our service with any options it requires | |
| app.use('/tickets', createService(options), (req, res) => { | |
| const doc = res.data; | |
| doc.pipe(res); | |
| return res.format({ 'application/pdf': () => doc.end() }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const errors = require('feathers-errors'); | |
| const PDFDocument = require('pdfkit'); | |
| const bwipjs = require('bwip-js'); | |
| /* eslint-disable no-unused-vars */ | |
| class Service { | |
| constructor (options) { | |
| this.options = options || {}; | |
| } |