GithubHelp home page GithubHelp logo

yelrom0 / random-image-displayer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 12 KB

This little program will display a random image from a folder specified.

License: MIT License

Dockerfile 23.37% JavaScript 66.09% Shell 10.55%

random-image-displayer's Introduction

Random Image Displayer

This little program will display a random image from a folder specified.

How Do I use it?

note: This guide is for Linux/Mac and assumes you have docker installed. If you're running Windows, use WSL.

  1. Check out app/server.js, this is where the magic happens.
  2. Under the Local Constants section, change the imageFolder to the folder you want to display images from and the port to whatever port you want to use.
  3. Put the images you want to display in the folder you specified.
  4. Run chmod +x on the buildandrun.sh file.
  5. Run ./buildandrun.sh in the terminal. Which will start the server.
  6. Open your browser and go to http://localhost:port where port is the port you specified in the Local Constants section.
  7. Refresh the page to see a new image.
  8. Enjoy!

Why did I make it?

  • I wanted to make a simple program that I could use to display random images for my wildcard subdomains.
  • I wanted to learn a little more Node.js and how to use it to create a simple server.
  • I was going to use Python/FastAPI (which I'm more familiar with) but I would have had to write a front-end in JS anyway.
  • It literally just took me a few minutes to make.

Who am I?

  • I'm Daniel Morley, a Backend Python Developer from Melbourne, Australia. I enjoy tinkering with my home server and sometimes write small projects like this (and sometimes some larger).

Can I modify it?

  • Sure! Feel free to modify it and share it with the world.

Can I test it without running it myself?

Will you update this in the future?

  • Maybe, but this wasn't the original idea. I was hoping to return a full 404 page with a random image and styling etc. Maybe I'll end up doing that and changing this project to something written in react.js, maybe I'll just leave it as is ¯\_(ツ)_/¯

random-image-displayer's People

Contributors

yelrom0 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.