Giter Club home page Giter Club logo

urlshortener's Introduction

URL Shortener

Might not be very efficient if you're hosting it on places like heroku and railway where they give you long links, but if you get a domain and everything, it works ๐Ÿ˜ƒ๐Ÿ‘

How to run?

  • To run the backend server, go into the backend folder, and run install_deps.bat. Once the installation of the required modules is complete, go into the src folder and run run.bat.
  • To run the frontend server, go into the frontend folder, and run install_deps.bat. Once the required modules have been installed, open a new terminal window and run npm start in the same directory as the package.json file.

How to deploy API? - Heroku

Limitations:

  • Will reset database, every time API restarts.
  • API goes to sleep after a certain amount of inactivity.

Procedure:

  • Download the heroku CLI
  • Download Git (Make sure to 'add to PATH')
  • Once downloaded, open up your terminal and type heroku login
  • Make a new file called Procfile (with no extension) and in that file, type web: node index.js
  • Make sure to change the port of your express API to process.env.PORT
  • You must have the node_modules folder when deploying.
  • Open a new terminal and navigate to the directory with the API in it.
  • Type git init
  • Type git add .
  • Type git commit -m "anything you want, or you could just leave this as is"
  • Type heroku create or heroku create {any name you would like
  • Then type git push heroku main, if that doesn't work type git push heroku master

How to deploy API? - Railway

Procedure:

  • Create a github repository, and upload the files for frontend and backend in separate branches.
  • Create an account at https://railway.app/, and link your github account (https://railway.app/account).
  • Go to the dashboard (https://railway.app/dashboard), and click New Project.
  • Click Deploy From Repo
  • Select the github repository you saved your code to, and select the correct branch
  • Click Deploy, sit back, and relax
  • Don't forget to change the baseURL in the config.json in the frontend's src folder to your newly railway-hosted API URL.

urlshortener's People

Contributors

mtbtrq 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.