A simple easy to deploy Link Shorter using express.js as the webserver, passport.js for user authentication and vue.js for the frontend.
- Change the environment variable in the
Dockerfile
(Optional) - Build the Docker image
docker build -t link-short .
- Run the Docker image
docker run -d --name link-short \
-e SESSION_SECRET=[your_session_secret] \
-v link-short:/link-short/server/data/ \
-p 3000:3000 \
--restart unless-stopped \
link-short
docker run -d --name link-short \
-p 3000:3000 \
-v link-short:/link-short/server/data/ \
--restart unless-stopped \
link-short
- Install dependencies
- For production
npm ci
- For development
npm install
- Configure the .env fille in the server directory (A sample is provided as
.env.sample
)
cp server/.env.sample server/.env
After copying the sample file don't forget to configure it 3. Start the server (make shure you are in the home directory of the application)
npm start
Then go to http://localhost:3000
- Redirect to link :
GET /:id_of_link
- Create new link :
POST /api/new
- Create new user :
POST /auth/register
- Login :
POST /auth/login
- Logout
- Get if logged in :
GET /auth/isloggedin/
- Remove user :
DELETE /api/user/remove/me
- List all users :
GET /api/user/all
- Change user type :
PATCH /api/user/alter/:user_id
- Remove user :
DELETE /api/user/remove/:user_id
- Delete link :
DELETE /api/remove
(Only links that I own) - List my links :
GET /api/my
- Delete link :
DELETE /api/remove
(Any links) - List all links :
GET /api/all
This project is covered under the MIT License