Git Product home page Git Product logo

url-shortener's Introduction

Node/Ionic URL Shortener

A simple url shortener made with Node and Mongo and a front end using said API made with Ionic.

Getting started

The project has 2 parts, the backend (the actual url shortener) and a implementation of the url shortener in an Ionic app.

Backend - Node Server

Using:

Install and run:

  1. First install Mongo and Node, the links and steps for that are in the Using segment above.

  2. Run the next lines after cloning the project:

$ cd ./url-shortener/backend
$ npm install
$ npm start

Frontend - Ionic App

Using:

Install and run:

  1. First install Mongo and Node, the links and steps for that are in the Using segment above.

  2. Run the next lines after cloning the project:

$ cd ./url-shortener/url-shortener
$ npm install -g ionic
$ npm install
$ ionic serve

Docs

Backend - Node Server

View specific documentation for the backend

The API is used through standard http requests. This are the expected results from get and post requests.

URL GET POST
http://youraddress/sites List of elements in the collection 'sites'. Adds an element to sites collection and returns status of transaction and inserted element or reason of failure.
http://youraddress/azb091 Redirects to website if successful, if not then returns a 404. No POST request for /:code.

Command line options

This are some command line options: Usage url-shortener: node index options arguments Options:

Command Action
-h, --help Prints all of the command line options
-p, --port [port number] Sets port name of the node server (3000 by default)
--mongo-db [mongo collection name] Sets the mongo collection ('short' by default)
--mongo-host [mongo hostname] Sets the hostname where mongoDB is (localhost by default)
--mongo-port [mongo port] Sets the port where mongoDB is (27017 by default)

Frontend - Ionic App

View specific documentation for the frontend

Authors

  • Fabrizzio Rivera - fabrv

License

This project is licensed under the GNU3.0 License - see the LICENSE file for details

url-shortener's People

Contributors

fabrv avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

url-shortener's Issues

Command line options

Is your feature request related to a problem? Please describe.
The only way to customize the server is through code editing.

Describe the solution you'd like
Some command line options, like adding a parameter --port that would change the port where the service will run.
Possible command line options:

  • --port, changes the port
  • --db, changes the Mongo database name

If the server is down, Loader will not dismiss

Describe the bug
If the server is down then the Loader in the 'Sitios' page won't dismiss.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Sitios'
  2. Click on 'Refresh'
    or
  3. Scroll to refresh
  4. See error

Expected behavior
If the server won't respond then dismiss the loader and show an error message.

Desktop (please complete the following information):

  • Windows 10
  • Every browser

Smartphone (please complete the following information):

  • Device: iPhone 6
  • OS: iOS 12
  • Every browser

Copy to clipboard in Ionic app

Is your feature request related to a problem? Please describe.
There is no easy way to copy and paste the shorten link once its saved.

Describe the solution you'd like
Add a button or option to copy to clipboard on the 'Sitios' page

Describe alternatives you've considered
Instead of a button that opens the shorten link maybe the button could open a dialog with an input to make the copying and pasting easier.

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.