This file contains 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
import Queue from 'bull' | |
const sendRatingMailQueue = new Queue('sendRatingMail', { | |
redis: { | |
host: '127.0.0.1', | |
port: 6379 | |
} | |
}) |
This file contains 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 data = { | |
email: 'foo@bar.com' | |
} | |
const options = { | |
delay: 86400000, | |
attempts: 3 | |
} | |
sendRatingMailQueue.add(data, options) |
This file contains 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
sendRatingMailQueue.process(async job => { | |
await sendRatingMailTo(job.data.email) | |
}) |
This file contains 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 { disallow } = require('feathers-hooks-common') | |
module.exports = { | |
before: { | |
all: [], | |
find: [], | |
get: [ | |
disallow() | |
], | |
create: [ |
This file contains 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
import { someFunction } from '../../../utils/file-with-stuff-i-need' |
This file contains 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
import { someFunction } from '@utils/file-with-stuff-i-need' |
This file contains 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
project/ | |
├─ tsconfig.json | |
├─ package.json | |
├─ src/ | |
│ ├─ index.ts | |
│ ├─ utils/ | |
│ │ ├─ file-with-stuff-i-need.ts |
This file contains 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
{ | |
"scripts": { | |
"dev": "ts-node-dev -r tsconfig-paths/register src/index.ts", | |
"start": "ts-node -r tsconfig-paths/register src/index.ts" | |
} | |
} |
This file contains 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
{ | |
"scripts": { | |
"dev": "ts-node-dev src/index.ts", | |
"start": "ts-node src/index.ts" | |
} | |
} |
This file contains 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
module.exports = { | |
preset: 'ts-jest', | |
testEnvironment: 'node' | |
} |
OlderNewer