Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
positive235 committed Jul 28, 2021
1 parent 038c148 commit 2664895
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
15 changes: 6 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
const puppeteer = require('puppeteer');
const express = require('express');
const path = require('path');
const app = express();



const urls = [
'https://unsplash.com/s/photos/natural',
'https://unsplash.com/s/photos/nature',
Expand Down Expand Up @@ -50,21 +47,21 @@ var images = [];
// };
// xhr.send();
// // images to localhost:5000/images
app.use(express.static(path.join(__dirname, 'public')))
app.set('views', path.join(__dirname, 'views'))
app.set('view engine', 'ejs')


app.get('/', (req, res) => res.send('hello'))

app.get('/images', (req, res) => {
//res.send(JSON.stringify({ ...images }));
res.send(JSON.parse(JSON.stringify(images)));
});

var server_port = process.env.PORT || 3000;
var server_host = '0.0.0.0';
app.listen(server_port, server_host, function() {

app.listen(server_port, function() {
console.log('Listening on port %d', server_port);
})
//console.log('Example app listening at %s', port);

})();


Expand Down
6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
"start": "nodemon index.js"
},
"author": "Hae-Ji Park",
"license": "ISC",
Expand All @@ -15,9 +15,5 @@
},
"devDependencies": {
"nodemon": "^2.0.12"
},
"engines": {
"node": ">=12.16.2",
"npm": ">=6.14.4"
}
}

0 comments on commit 2664895

Please sign in to comment.