change to import/export from required/export

This commit is contained in:
Strife 2025-05-11 15:14:03 +05:00
parent 94c12b4533
commit 1f85ebc3d9
7 changed files with 14 additions and 13 deletions

BIN
.DS_Store vendored

Binary file not shown.

4
db.js
View File

@ -1,4 +1,4 @@
const knex = require('knex'); import knex from 'knex';
const initializeDb = () => { const initializeDb = () => {
const dbConfig = { const dbConfig = {
@ -19,4 +19,4 @@ const initializeDb = () => {
const db = initializeDb(); const db = initializeDb();
module.exports = db; export {db};

View File

@ -1,10 +1,10 @@
const express = require('express'); import express from 'express';
const cors = require("cors"); import cors from "cors";
const bodyParser = require('body-parser'); import bodyParser from 'body-parser';
const auth = require("./routes/auth/auth"); import {auth} from "./routes/auth/auth.js";
const checkSession = require("./routes/auth/checkSession"); import {checkSession} from "./routes/auth/checkSession.js"
const ping = require("./routes/test/ping"); import {ping} from "./routes/test/ping.js";
const authIgnorePaths = ['/ping'] const authIgnorePaths = ['/ping']

View File

@ -1,5 +1,6 @@
{ {
"name": "projectName", "name": "projectName",
"type": "module",
"version": "1.0.0", "version": "1.0.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",

View File

@ -1,4 +1,4 @@
const db = require('../../db'); import {db} from '../../db.js';
const auth = async (body) => { const auth = async (body) => {
try { try {
@ -28,4 +28,4 @@ const auth = async (body) => {
} }
} }
module.exports = auth; export {auth};

View File

@ -1,4 +1,4 @@
const db = require('../../db'); import {db} from '../../db.js';
const checkSession = async (token) => { const checkSession = async (token) => {
try { try {
@ -13,4 +13,4 @@ const checkSession = async (token) => {
} }
} }
module.exports = checkSession; export {checkSession};

View File

@ -10,4 +10,4 @@ const ping = async (data) => {
} }
} }
module.exports = ping; export {ping};