Browse Source

Change dockerfile/ app port to 8080

Also added vs code debug file.
master
Haris Razis 4 years ago
parent
commit
588cd0caae
  1. 3
      package-lock.json
  2. 28
      web/.vscode/launch.json
  3. 2
      web/bin/www
  4. 2
      web/dockerfile
  5. 4
      web/package.json
  6. 6
      web/public/javascripts/search.js

3
package-lock.json

@ -0,0 +1,3 @@
{
"lockfileVersion": 1
}

28
web/.vscode/launch.json

@ -0,0 +1,28 @@
// flatpak run org.mozilla.firefox --start-debugger-server
{
"version": "0.2.0",
"configurations": [
{
"type": "firefox",
"request": "attach",
"name": "Attach Firefox",
"url": "http://127.0.0.1:3000/",
"webRoot": "${workspaceFolder}",
"pathMappings": [
{
"url": "http://127.0.0.1:3000",
"path": "${workspaceFolder}/public"
}
]
},
{
"type": "node",
"request": "attach",
"name": "Node: Nodemon",
"processId": "${command:PickProcess}",
"restart": true,
"protocol": "inspector"
}
]
}

2
web/bin/www

@ -12,7 +12,7 @@ var http = require('http');
* Get port from environment and store in Express.
*/
var port = normalizePort('3000'); //Fixed port for docker
var port = normalizePort('8080'); //Fixed port for docker
app.set('port', port);
/**

2
web/dockerfile

@ -15,5 +15,5 @@ RUN npm install
# Bundle app source
COPY . .
EXPOSE 3000
EXPOSE 8080
CMD [ "node", "./bin/www" ]

4
web/package.json

@ -4,7 +4,7 @@
"private": true,
"scripts": {
"start": "node ./bin/www",
"dev": "nodemon ./bin/www"
"debug": "nodemon --inspect ./bin/www"
},
"dependencies": {
"cookie-parser": "~1.4.4",
@ -19,4 +19,4 @@
"morgan": "~1.9.1",
"nodemon": "^2.0.4"
}
}
}

6
web/public/javascripts/search.js

@ -1,6 +1,6 @@
$("#search").on("keyup", () => {
var searchValue = $("#search").val().toLowerCase();
$(".card .card-body .card-title").each(function () { // es6 arrow function wont work with 'this'
$(".card .card-body .card-title").each(function () {
var title = $(this);
if (title.text().toLowerCase().includes(searchValue)) {
$(this).parent().parent().show();
@ -20,4 +20,6 @@ $("#search-docs").on("keyup", () => {
$(this).hide();
}
});
});
});
//refractor both searches
Loading…
Cancel
Save