Skip to content

juhaj77/photo-gallery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Photo gallery

Stores images to MongoDB utilizing multer. This solution is easy to extend to uploading multiple files at once. Todo: 1. gridFS for bigger than 16Mb pics.

try it

app on Render

Prerequisites

npm package manager and mongodb uri

Installing

/photo-gallery/server>npm install
/photo-gallery/client>npm install

create .env file with content:

    MONGODB_URI=mongodb://127.0.0.1:27017
    PORT=8000
    NODE_ENV=developtment

fix urlPrefix in client/src/util/config.js (see comments)...

option A usage in production mode:

  1. set NODE_ENV=production
  2. build and run
/photo-gallery/client>npm run build
/photo-gallery/client>cp -r build ../server
/photo-gallery/server>node server.js

and open http://localhost:8000/ in browser. Now folder ./server has all what you need to deploy this on a live system

option B usage in development mode:

/photo-gallery/server>node server.js
/photo-gallery/client>npm start

what it looks like: kuvagalleria