URL shortener.
Server: Node.js, Express, MongoDB, mongoose.
Client: Vue.js
Extra packages: vue-toasted, vue-clipboard2, valid-url, shortid, dotenv
quttai - word from Kazakh құттай ("small").
- Clone repository
git clone https://github.com/zshanabek/quttai
cd quttai/server
- Install dependencies
npm install
- Create the environment variables file. Here I pasted connection url to my remote database, but you can past your database's url. Create a remote mongodb database here
echo "BASE_URL=http://localhost:5000" >> .env
echo "PORT=5000" >> .env
echo "MONGODB_URL='mongodb://zshanabek:[email protected]:41647/nodejs-url-shortener" >> .env
- Install HTTPie. It is a command line HTTP client
apt-get install httpie
- Run server
npm start
- Shorten long url
http post localhost:5000/api/items url=https://twitter.com/theshanabek/status/1180694065014349825
- Expect short url in response and then past it somewhere
{
"success": true,
"url": "http://localhost:5000/api/items/HJY15wCXe"
}
- Go to
client
directory
cd quttai/client
- Install dependencies
npm install
- Run server
npm run serve
- App is running here: http://localhost:8080