-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.js
237 lines (199 loc) · 8.15 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
// *************************************************************
// Gov.UK public user search - App.js is the subset of server.js
// *************************************************************
const express = require("express");
const app = express();
const fs = require("fs");
const request = require("request");
const methodOverride = require("method-override");
const path = require("path");
const fileUpload = require("express-fileupload");
const fetch = require("node-fetch");
const { callbackify } = require("util");
const { Http2ServerRequest } = require("http2");
const { contains } = require("jquery");
const axios = require("axios");
app.set("views", path.join(__dirname, "views"));
app.set("view engine", "ejs");
app.use(express.urlencoded({ extended: false }));
app.use(methodOverride("_method"));
app.use(express.static(__dirname + "/public"));
var cors = require("cors");
app.use(cors());
// ********************************************************
// Gov.UK public user search - Global variable declarations
// ********************************************************
app.locals.radio_beneficiaryname;
app.locals.text_beneficiaryname;
app.locals.subsidy_objective_isfirst;
app.locals.subsidy_instrument_isfirst;
app.locals.spending_sector_isfirst;
app.locals.actual_subsidy_objective;
app.locals.actual_spending_sector;
app.locals.actual_subsidy_instrument;
app.locals.actual_subsidy_objective_pass1;
app.locals.actual_spending_sector_pass1;
app.locals.actual_subsidy_instrument_pass1;
app.locals.radio_legalgrantingdate;
app.locals.date_legal_granting_date_day;
app.locals.date_legal_granting_date_month;
app.locals.date_legal_granting_date_year;
app.locals.date_legal_granting_date_day1;
app.locals.date_legal_granting_date_month1;
app.locals.date_legal_granting_date_year1;
app.locals.date_legal_granting_date_day_Error;
app.locals.date_legal_granting_date_month_Error;
app.locals.date_legal_granting_date_year_Error;
app.locals.date_legal_granting_date_day1_Error;
app.locals.date_legal_granting_date_month1_Error;
app.locals.date_legal_granting_date_year1_Error;
app.locals.legal_granting_from_date;
app.locals.legal_granting_to_date;
app.locals.frontend_totalRecordsPerPage;
app.locals.previous_page;
app.locals.next_page;
app.locals.current_page;
app.locals.start_page;
app.locals.end_page;
app.locals.email_addresspass;
app.locals.searchawards;
app.locals.pageCount;
app.locals.rowsperpage;
app.locals.totalrows;
app.locals.start_record;
app.locals.end_record;
app.locals.current_page_active;
app.locals.response_error_message;
app.locals.check_subsidyobjective0;
app.locals.check_subsidyobjective1;
app.locals.check_subsidyobjective2;
app.locals.check_subsidyobjective3;
app.locals.check_subsidyobjective4;
app.locals.check_subsidyobjective5;
app.locals.check_subsidyobjective6;
app.locals.check_subsidyobjective7;
app.locals.check_subsidyobjective8;
app.locals.check_subsidyobjective9;
app.locals.check_subsidyobjective10;
app.locals.check_subsidyobjective11;
app.locals.check_subsidyobjective11_pass;
app.locals.check_subsidyobjective12;
app.locals.check_subsidyobjective12_pass;
app.locals.check_spendingsector0;
app.locals.check_spendingsector1;
app.locals.check_spendingsector2;
app.locals.check_spendingsector3;
app.locals.check_spendingsector4;
app.locals.check_spendingsector5;
app.locals.check_spendingsector6;
app.locals.check_spendingsector7;
app.locals.check_spendingsector8;
app.locals.check_spendingsector9;
app.locals.check_spendingsector10;
app.locals.check_spendingsector11;
app.locals.check_spendingsector12;
app.locals.check_spendingsector13;
app.locals.check_spendingsector13a;
app.locals.check_spendingsector14;
app.locals.check_spendingsector15;
app.locals.check_spendingsector16;
app.locals.check_spendingsector17;
app.locals.check_spendingsector18;
app.locals.check_spendingsector19;
app.locals.check_spendingsector20;
app.locals.check_subsidyinstrument0;
app.locals.check_subsidyinstrument1;
app.locals.check_subsidyinstrument2;
app.locals.check_subsidyinstrument3;
app.locals.check_subsidyinstrument4;
app.locals.check_subsidyinstrument5;
app.locals.check_subsidyinstrument6;
app.locals.check_subsidyinstrument7;
app.locals.check_subsidyinstrument8;
app.locals.check_subsidyinstrument8_pass;
app.locals.check_subsidyinstrument9;
app.locals.check_subsidyinstrument9_pass;
app.locals.check1_subsidyobjective1;
app.locals.beneficiary_sorting_order;
app.locals.subsidyamount_sorting_order;
app.locals.legalgrantingdate_sorting_order;
app.locals.sorting_order_pass;
app.locals.beneficiary_arrow;
app.locals.subsidyamount_arrow;
app.locals.legalgrantingdate_arrow;
app.locals.searchawarddetails;
app.locals.searchmeasuredetails;
app.locals.data_request_clientside;
app.locals.beis_url_publicsearch;
app.locals.beis_url_accessmanagement;
app.locals.awardnumber;
/***************************************************** */
/* Default login screen - Web application Launch screen */
/****************************************************** */
app.get("/", (req, res) => {
res.set("X-Frame-Options", "DENY");
res.set("X-Content-Type-Options", "nosniff");
res.set("Content-Security-Policy", 'frame-ancestors "self"');
res.set("Access-Control-Allow-Origin", beis_url_publicsearch);
res.render("publicusersearch/homepage");
});
/****************************************************** */
/* All Router declarations */
/****************************************************** */
var homepage = require("./routes/homepage");
app.use("/homepage", homepage);
var beneficiaryname = require("./routes/beneficiaryname");
app.use("/beneficiaryname", beneficiaryname);
var subsidyobjective = require("./routes/subsidyobjective");
app.use("/subsidyobjective", subsidyobjective);
var subsidyinstrument = require("./routes/subsidyinstrument");
app.use("/subsidyinstrument", subsidyinstrument);
var spendingsector = require("./routes/spendingsector");
app.use("/spendingsector", spendingsector);
var legalgrantingdate = require("./routes/legalgrantingdate");
app.use("/legalgrantingdate", legalgrantingdate);
var searchresults = require("./routes/searchresults");
app.use("/searchresults", searchresults);
var searchresults = require("./routes/schemes");
app.use("/schemes", searchresults);
var standaloneawards = require("./routes/standaloneawards");
app.use("/standaloneawards", standaloneawards);
var pageroute = require("./routes/pageroute");
app.use("/pageroute", pageroute);
var noresults = require("./routes/noresults");
app.use("/noresults", noresults);
var filtersearch = require("./routes/filtersearch");
app.use("/filtersearch", filtersearch);
var updateresults = require("./routes/updateresults");
app.use("/updateresults", updateresults);
var updateresultsroute = require("./routes/updateresultsroute");
app.use("/updateresultsroute", updateresultsroute);
var hidefilter = require("./routes/hidefilter");
app.use("/hidefilter", hidefilter);
var searchresultsmeasureroute = require("./routes/searchresultsmeasureroute");
app.use("/searchresultsmeasureroute", searchresultsmeasureroute);
var schemedetailsroute = require("./routes/schemedetailsroute");
app.use("/scheme", schemedetailsroute);
var schemeVersionRoute = require("./routes/schemeversionroute");
app.use("/schemeversion", schemeVersionRoute);
var searchresultsawardroute = require("./routes/searchresultsawardroute");
app.use("/searchresultsawardroute", searchresultsawardroute);
var pageperroute = require("./routes/pageperroute");
app.use("/pageperroute", pageperroute);
var updateresultspageperroute = require("./routes/updateresultspageperroute");
app.use("/updateresultspageperroute", updateresultspageperroute);
var feedbackform = require("./routes/feedbackform");
app.use("/feedbackform", feedbackform);
var submitfeedback = require("./routes/submitfeedback");
app.use("/submitfeedback", submitfeedback);
var accessibilityStatement = require("./routes/accessibilityStatement");
app.use("/accessibilityStatement", accessibilityStatement);
app.use("/mfaawards", require("./routes/mfaawards"));
app.use("/mfaaward", require("./routes/mfaawarddetails"));
// Cookies Consent
var cookieshelp = require("./routes/cookies-help");
app.use("/cookieshelp", cookieshelp);
// Privacy Notice
var privacynotice = require("./routes/privacy-notice");
app.use("/privacy", privacynotice);
module.exports = app;