Skip to content

Commit

Permalink
hostname debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mrspartak committed Feb 24, 2020
1 parent b992f5d commit 41d1021
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@

/* serve requests */
const server = http.createServer(async (request, response) => {
let { pathname, query } = url.parse(request.url);
let { hostname, pathname, query } = url.parse(request.url);
query = querystring.parse(query);
let queryLang = query.lang && (query.lang == 'ru' || query.lang == 'en') ? query.lang : false;

let language = queryLang ? queryLang : __.detectLanguage(request);
if (DEBUG) console.log('req', language, pathname);
if (DEBUG) console.log('req', language, hostname, pathname);

response.setHeader('Access-Control-Allow-Origin', '*');
response.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
Expand Down

0 comments on commit 41d1021

Please sign in to comment.