A simple url shortener made with Node and Mongo and a front end using said API made with Ionic.
The project has 2 parts, the backend (the actual url shortener) and a implementation of the url shortener in an Ionic app.
Using:
Install and run:
-
First install Mongo and Node, the links and steps for that are in the Using segment above.
-
Run the next lines after cloning the project:
$ cd ./url-shortener/backend
$ npm install
$ npm start
Using:
Install and run:
-
First install Mongo and Node, the links and steps for that are in the Using segment above.
-
Run the next lines after cloning the project:
$ cd ./url-shortener/url-shortener
$ npm install -g ionic
$ npm install
$ ionic serve
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. |
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) |
View specific documentation for the frontend
- Fabrizzio Rivera - fabrv
This project is licensed under the GNU3.0 License - see the LICENSE file for details