tango-app-api-trax 3.7.2-multireff-14 → 3.7.2-multireff-15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/app.js +0 -55
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tango-app-api-trax",
|
|
3
|
-
"version": "3.7.2-multireff-
|
|
3
|
+
"version": "3.7.2-multireff-15",
|
|
4
4
|
"description": "Trax",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start": "nodemon --exec \"eslint --fix . && node
|
|
8
|
+
"start": "nodemon --exec \"eslint --fix . && node index.js\""
|
|
9
9
|
},
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=18.10.0"
|
package/app.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import express from 'express';
|
|
3
|
-
import { traxRouter, mobileRouter, traxFlagRouter, traxDashboardRouter, galleryRouter, internalTraxRouter, downloadRouter } from './index.js';
|
|
4
|
-
import responseMiddleware from './config/response/response.js';
|
|
5
|
-
import errorMiddleware from './config/response/response.js';
|
|
6
|
-
import dotenv from 'dotenv';
|
|
7
|
-
import { logger } from 'tango-app-api-middleware';
|
|
8
|
-
import { connectdb } from './config/database/database.js';
|
|
9
|
-
import cors from 'cors';
|
|
10
|
-
import pkg from 'body-parser';
|
|
11
|
-
import fileupload from 'express-fileupload';
|
|
12
|
-
import admin from 'firebase-admin';
|
|
13
|
-
const serviceAccountPath = JSON.parse( process.env.FIREBASE );
|
|
14
|
-
admin.initializeApp( {
|
|
15
|
-
credential: admin.credential.cert( serviceAccountPath ),
|
|
16
|
-
} );
|
|
17
|
-
const env=dotenv.config();
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const app = express();
|
|
21
|
-
const PORT = process.env.PORT || 3000;
|
|
22
|
-
const { json, urlencoded } =pkg;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if ( env.error ) {
|
|
26
|
-
logger.error( '.env not found' );
|
|
27
|
-
process.exit( 1 );
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
app.use( cors() );
|
|
31
|
-
app.use( responseMiddleware );
|
|
32
|
-
app.use( errorMiddleware );
|
|
33
|
-
app.use( json( { limit: '500mb' } ) );
|
|
34
|
-
app.use( fileupload() );
|
|
35
|
-
app.use(
|
|
36
|
-
urlencoded( {
|
|
37
|
-
extended: true,
|
|
38
|
-
} ),
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
app.use( '/trax', traxRouter );
|
|
42
|
-
app.use( '/trax/flag', traxFlagRouter );
|
|
43
|
-
app.use( '/trax/mobileAPI', mobileRouter );
|
|
44
|
-
app.use( '/trax/dashboard', traxDashboardRouter );
|
|
45
|
-
app.use( '/gallery', galleryRouter );
|
|
46
|
-
app.use( '/trax/internalAPI', internalTraxRouter );
|
|
47
|
-
app.use( '/trax/downloads', downloadRouter );
|
|
48
|
-
|
|
49
|
-
const host = '0.0.0.0';
|
|
50
|
-
|
|
51
|
-
app.listen( PORT, host, () => {
|
|
52
|
-
logger.info( `server is running on port= ${PORT} ` );
|
|
53
|
-
connectdb();
|
|
54
|
-
} );
|
|
55
|
-
|