Skip to content

Instantly share code, notes, and snippets.

View fmoessle's full-sized avatar

Florian Streise fmoessle

View GitHub Profile
const data = {
email: 'foo@bar.com'
}
const options = {
delay: 86400000,
attempts: 3
}
sendRatingMailQueue.add(data, options)
import Queue from 'bull'
const sendRatingMailQueue = new Queue('sendRatingMail', {
redis: {
host: '127.0.0.1',
port: 6379
}
})
sendRatingMailQueue.process(async job => {
await sendRatingMailTo(job.data.email)
})
const { disallow } = require('feathers-hooks-common')
module.exports = {
before: {
all: [],
find: [],
get: [
disallow()
],
create: [
import { someFunction } from '../../../utils/file-with-stuff-i-need'
import { someFunction } from '@utils/file-with-stuff-i-need'
project/
├─ tsconfig.json
├─ package.json
├─ src/
│ ├─ index.ts
│ ├─ utils/
│ │ ├─ file-with-stuff-i-need.ts
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node'
}
const { pathsToModuleNameMapper } = require('ts-jest/utils')
const { compilerOptions } = require('./tsconfig')
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
// this enables us to use tsconfig-paths with jest
modulePaths: [compilerOptions.baseUrl],
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths)
{
"scripts": {
"dev": "ts-node-dev src/index.ts",
"start": "ts-node src/index.ts"
}
}