Skip to content

Commit

Permalink
Issue #IQ-546 feat: Move environment variables from server.js to .env…
Browse files Browse the repository at this point in the history
… file
  • Loading branch information
vaibhavbhuva committed Aug 10, 2023
1 parent 2a0d1af commit 31ede31
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 132 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ Thumbs.db


# Web components Files
project-sunbird-sunbird-questionset-editor-web-component-*
project-sunbird-sunbird-questionset-editor-web-component-*

.env
252 changes: 126 additions & 126 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"protractor": "~7.0.0",
"ts-node": "~7.0.0",
"tslint": "~6.1.0",
"typescript": "4.9.5"
"typescript": "4.9.5",
"dotenv": "^16.3.1"
}
}
10 changes: 7 additions & 3 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ var express = require('express'),
proxy = require('express-http-proxy'),
urlHelper = require('url');
const latexService = require('./latexService.js')
const dotenv = require('dotenv');
dotenv.config();

const BASE_URL = "dev.inquiry.sunbird.org";
const API_AUTH_TOKEN = "";
const USER_TOKEN = "";
const BASE_URL = process.env.BASE_URL || "dev.inquiry.sunbird.org";
const API_AUTH_TOKEN = process.env.AUTH_API_TOKEN;
const USER_TOKEN = process.env.USER_API_TOKEN;
const PORTAL_COOKIES= ""

var app = express();
Expand All @@ -16,6 +18,8 @@ app.use(express.json())
app.get("/latex/convert", latexService.convert)
app.post("/latex/convert", bodyParser.json({ limit: '1mb' }), latexService.convert);
app.use(express.static(__dirname + '/web-component-examples/vanilla-js'));


app.all(['/api/framework/v1/read/*',
'/learner/framework/v1/read/*',
'/api/channel/v1/read/*',
Expand Down
7 changes: 6 additions & 1 deletion src/app/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const questionSetEditorConfig = {
lastName: 'User',
orgIds: ['01309282781705830427']
},
identifier: 'do_21385722788845158418',
identifier: 'do_213858102169174016131',
authToken: ' ',
sid: 'iYO2K6dOSdA0rwq7NeT1TDzS-dbqduvV',
did: '7e85b4967aebd6704ba1f604f20056b6',
Expand Down Expand Up @@ -113,6 +113,11 @@ export const questionSetEditorConfig = {
},
correctionComments: false,
sourcingResourceStatus: true,
cloudStorage: {
presigned_headers: {
'x-ms-blob-type': 'BlockBlob'
}
}
},
config: {
mode: 'edit', // edit / review / read / sourcingReview // orgReview
Expand Down
5 changes: 5 additions & 0 deletions web-component-examples/vanilla-js/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@
},
correctionComments: false,
sourcingResourceStatus: true,
cloudStorage: {
presigned_headers: {
'x-ms-blob-type': 'BlockBlob'
}
}
},
config: {
mode: 'edit', // edit / review / read / sourcingReview // orgReview
Expand Down

0 comments on commit 31ede31

Please sign in to comment.