Skip to content

Commit

Permalink
fix(api): don't treat project as a module
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Aug 30, 2024
1 parent aa292d3 commit 9127726
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions api/get-market-data.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Dependencies required by ./utils (see below) need to be explicitly required
// here to ensure that that they are included in serverless builds. Do NOT
// remove them unless they are not needed by any upstream modules.
import { promisify } from 'util'
const { promisify } = require('util')

import 'redis'
import '../src/common/utils'
require('redis')
require('../src/common/utils')
// End explicit requires for serverless builds

import {
const {
allowCors,
getRedisClient,
getRoomData,
getRoomName,
} from '../api-etc/utils'
} = require('../api-etc/utils')

const client = getRedisClient()

Expand Down
16 changes: 8 additions & 8 deletions api/post-day-results.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
// Dependencies required by ./utils (see below) need to be explicitly required
// here to ensure that that they are included in serverless builds. Do NOT
// remove them unless they are not needed by any upstream modules.
import 'redis'
import '../src/common/utils'
import '../src/common/constants'
import '../api-etc/constants'
require('redis')
require('../src/common/utils')
require('../src/common/constants')
require('../api-etc/constants')
// End explicit requires for serverless builds

import { promisify } from 'util'
const { promisify } = require('util')

import {
const {
allowCors,
getRedisClient,
getRoomData,
getRoomName,
} from '../api-etc/utils'
import { random } from '../src/common/utils'
} = require('../api-etc/utils')
const { random } = require('../src/common/utils')

const client = getRedisClient()

Expand Down
16 changes: 8 additions & 8 deletions api/publish-global-market-values-to-discord.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Dependencies required by ./utils (see below) need to be explicitly required
// here to ensure that that they are included in serverless builds. Do NOT
// remove them unless they are not needed by any upstream modules.
import 'redis'
import '../src/common/utils'
import '../src/common/constants'
import '../api-etc/constants'
require('redis')
require('../src/common/utils')
require('../src/common/constants')
require('../api-etc/constants')
// End explicit requires for serverless builds

import { promisify } from 'util'
const { promisify } = require('util')

import axios from 'axios'
const axios = require('axios')

import { MARKET_SUMMARY_FOR_DISCORD } from '../api-etc/templates'
import { allowCors, getRedisClient, getRoomData } from '../api-etc/utils'
const { MARKET_SUMMARY_FOR_DISCORD } = require('../api-etc/templates')
const { allowCors, getRedisClient, getRoomData } = require('../api-etc/utils')

const client = getRedisClient()

Expand Down

0 comments on commit 9127726

Please sign in to comment.