Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xxlabaza/nodejs-url-shortener
Yet another URL Shortener
https://github.com/xxlabaza/nodejs-url-shortener
bootstrap ejs express nodejs tutorial url-shortener
Last synced: 3 days ago
JSON representation
Yet another URL Shortener
- Host: GitHub
- URL: https://github.com/xxlabaza/nodejs-url-shortener
- Owner: xxlabaza
- License: apache-2.0
- Created: 2020-03-19T14:14:42.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T01:41:51.000Z (almost 2 years ago)
- Last Synced: 2024-11-05T14:15:46.324Z (about 2 months ago)
- Topics: bootstrap, ejs, express, nodejs, tutorial, url-shortener
- Language: JavaScript
- Size: 1.67 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Overview
This is a yet another implementation of an URL shortener service based on **Web Dev Simplified** [tutorial](https://www.youtube.com/watch?v=SLpUKAGnm-g&t=25s) and customised (try to find my own NodeJS style...) by me.
The project's features:
* its frontend made with `Bootstrap` and `EJS` templates;
* stores data in `MongoDB` via `mongoose` library;
* runs `ESLint` before the tests;
* it has the tests with power of `Jest` and `supertest` (for API checks);
* uses `nodemon` for automaticaly restarting app during the development;
* it uses `Docker` and `docker-compose` tools for distribution, local launch and testing.## Launch
### Docker compose
To run the project with a `docker-compose` tool, just type the following in a terminal:
```bash
$> docker-compose up --detach
Creating mongodb ... done
Creating url-shortener ... done
```To stop the project:
```bash
$> docker-compose stop
Stopping url-shortener ... done
Stopping mongodb ... done
```### Developer mode
To run the project in develop mode, start a **MongoDB** database, for example via a **Docker**:
```bash
$> docker run -p 27017:27017 mongo:4.2.3
...
```Then, start the project itself:
```bash
$> npm run start:dev> [email protected] start-dev /url-shortener
> nodemon main.js[nodemon] 2.0.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching dir(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node main.js`
...
```## Open the project
Open [localhost:5000](http://localhost:5000) (port **5000** - is default) in your web browser and see something like this:
![filled table](https://github.com/xxlabaza/nodejs-url-shortener/blob/master/.screenshots/screenshot-1.png?raw=true)