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 dbConfig = {
@ -19,4 +19,4 @@ const initializeDb = () => {
const db = initializeDb();
module.exports = db;
export {db};

View File

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

View File

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

View File

@ -1,4 +1,4 @@
const db = require('../../db');
import {db} from '../../db.js';
const auth = async (body) => {
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) => {
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};