tango-app-api-analysis-traffic 3.0.0-alpha.0

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/.eslintrc.cjs ADDED
@@ -0,0 +1,41 @@
1
+
2
+ module.exports = {
3
+ 'env': {
4
+ 'es2021': true,
5
+ 'node': true,
6
+ },
7
+ 'extends': 'google',
8
+ 'overrides': [
9
+ {
10
+ 'env': {
11
+ 'node': true,
12
+ },
13
+ 'files': [
14
+ '.eslintrc.{js,cjs}',
15
+ ],
16
+ 'parserOptions': {
17
+ 'sourceType': 'script',
18
+ },
19
+ },
20
+ ],
21
+ 'parserOptions': {
22
+ 'ecmaVersion': 'latest',
23
+ 'sourceType': 'module',
24
+ },
25
+ 'rules': {
26
+ 'linebreak-style': [ 'error', 'windows' ],
27
+ 'require-jsdoc': 'off',
28
+ 'arrow-spacing': 'error',
29
+ 'key-spacing': [ 'error', { 'beforeColon': false, 'afterColon': true } ],
30
+ 'object-curly-spacing': [ 'error', 'always' ],
31
+ 'space-in-parens': [ 'error', 'always' ],
32
+ 'keyword-spacing': 'error',
33
+ 'array-bracket-spacing': [ 'error', 'always' ],
34
+ 'spaced-comment': [ 'error', 'always' ],
35
+ 'max-len': [ 'error', { 'code': 700 } ],
36
+ 'no-unused-vars': 'error',
37
+ 'new-cap': [ 'error', { 'newIsCap': true, 'capIsNew': false } ],
38
+ 'prefer-const': 'off',
39
+ },
40
+ };
41
+
package/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # README #
2
+
3
+ This README would normally document whatever steps are necessary to get your application up and running.
4
+
5
+ ### What is this repository for? ###
6
+
7
+ * Quick summary
8
+ * Version
9
+ * [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
10
+
11
+ ### How do I get set up? ###
12
+
13
+ * Summary of set up
14
+ * Configuration
15
+ * Dependencies
16
+ * Database configuration
17
+ * How to run tests
18
+ * Deployment instructions
19
+
20
+ ### Contribution guidelines ###
21
+
22
+ * Writing tests
23
+ * Code review
24
+ * Other guidelines
25
+
26
+ ### Who do I talk to? ###
27
+
28
+ * Repo owner or admin
29
+ * Other community or team contact
package/app.js ADDED
@@ -0,0 +1,40 @@
1
+ import express from 'express';
2
+ import { analysisTrafficRouter } from './index.js';
3
+
4
+ import dotenv from 'dotenv';
5
+ import pkg from 'body-parser';
6
+ const { json, urlencoded } = pkg;
7
+ import { logger } from 'tango-app-api-middleware';
8
+ import { connectdb } from './config/database/database.js';
9
+ import responseMiddleware from './config/response/response.js';
10
+ import errorMiddleware from './config/response/error.js';
11
+ import cors from 'cors';
12
+
13
+ const env=dotenv.config();
14
+
15
+ const app = express();
16
+ const PORT = process.env.PORT || 3000;
17
+ app.use( cors() );
18
+
19
+
20
+ if ( env.error ) {
21
+ logger.error( '.env not found' );
22
+ process.exit( 1 );
23
+ }
24
+
25
+ app.use( json( { limit: '500mb' } ) );
26
+ app.use(
27
+ urlencoded( {
28
+ extended: true,
29
+ } ),
30
+ );
31
+
32
+ app.use( responseMiddleware );
33
+ app.use( errorMiddleware );
34
+
35
+ app.use( '/api', analysisTrafficRouter );
36
+
37
+ app.listen( PORT, () => {
38
+ console.log( `server is running on port= ${PORT} ` );
39
+ connectdb();
40
+ } );
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+
2
+
3
+ import { analysisTrafficRouter } from './src/routes/traffic.routes.js';
4
+
5
+ export { analysisTrafficRouter };
6
+
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "tango-app-api-analysis-traffic",
3
+ "version": "3.0.0-alpha.0",
4
+ "description": "Traffic Analysis",
5
+ "main": "app.js",
6
+ "type": "module",
7
+ "scripts": {
8
+ "start": "nodemon --exec \"eslint --fix . && node app.js\""
9
+ },
10
+ "engines": {
11
+ "node": ">=18.10.0"
12
+ },
13
+ "author": "praveenraj",
14
+ "license": "ISC",
15
+ "dependencies": {
16
+ "aws-sdk": "^2.1665.0",
17
+ "dotenv": "^16.4.5",
18
+ "express": "^4.19.2",
19
+ "handlebars": "^4.7.8",
20
+ "lodash": "^4.17.21",
21
+ "mongodb": "^6.8.0",
22
+ "nodemon": "^3.1.4",
23
+ "tango-api-schema": "^2.0.131",
24
+ "tango-app-api-middleware": "^3.1.26",
25
+ "winston": "^3.13.1",
26
+ "winston-daily-rotate-file": "^5.0.0"
27
+ },
28
+ "devDependencies": {
29
+ "eslint": "^8.57.0",
30
+ "eslint-config-google": "^0.14.0",
31
+ "eslint-config-semistandard": "^17.0.0",
32
+ "eslint-config-standard": "^17.1.0",
33
+ "eslint-plugin-import": "^2.29.1",
34
+ "eslint-plugin-promise": "^6.6.0"
35
+ }
36
+ }