- Go to google-photos folder and run
npm install
.
- Go to google-photos folder and run
npm start
ornode server.js
- Otherewise you can install
node PM2
to run it. You can find PM2 Installation here.- Then Go to google-photos folder and run
pm2 start server.js
in cmd/Terminal
- method:
GET
, route:/get-one-album-urls/<id>
, Respons:array[] of URLs
- method:
GET
, route:/get-all-album-urls
, Respons:array[] of URLs
.
Run command in terminal/cmd on google-photos folder to sync photos manually in your g-photos.json file.
node -e 'require("./google-photos").getPhotosFromFile()'
- URL /get-one-album-urls
axios.get(
http://localhost:3002/get-one-album-urls/${id}
)
- URL /get-all-album-urls
axios.get(
http://localhost:3002/get-all-album-urls
)
- URL /get-one-album-urls
//Replace album id in the url
fetch(
http://localhost:3002/get-one-album-urls/${id}
) then( function(response) { if (response.status !== 200) { console.log('Looks like there was a problem. Status Code: ' + response.status); return; } // Examine the text in the response response.json().then(function(data) { console.log(data); }); } ) .catch(function(err) { console.log('Fetch Error :-S', err); });
- URL /get-all-album-urls
fetch(
http://localhost:3002/get-all-album-urls
) .then(function(response) { if (response.status !== 200) { console.log('Looks like there was a problem. Status Code: ' + response.status); return; } // Examine the text in the response response.json().then(function(data) { console.log(data); }); } ) .catch(function(err) { console.log('Fetch Error :-S', err); });