GitPedia

Short url

🔗 short url app elixir Phoenix

From imfycc·Updated April 20, 2026·View on GitHub·
·Archived

**short url** is a 🔗 short url app elixir Phoenix The project is written primarily in Elixir, distributed under the MIT License license, first published in 2018. Key topics include: elixir, elixir-apps, elixir-lang, elixir-phoenix, phoenix-application.

ShortUrl

MIT
elixir

短链接生成应用

体验

预览地址

Gigalixir 提供免费部署服务,该地址只用于体验,:warning: 不提供数据维护存储。

预览图

image

系统设计

短网址(short URL)系统的原理及其实现

准备工作

安装elixir

http://elixir-lang.org/install.html

安装postgreSQL

首次运行

  • 安装依赖 mix deps.get
  • 创建数据库及数据表 mix ecto.create && mix ecto.migrate
  • 安装前端依赖 cd assets && yarn install
  • 启动服务 mix phx.server
  • 访问应用 localhost:4000

调试

进入控制台:

shell
iex -S mix

格式化代码

shell
mix format

部署

可以参考这篇文章 使用 edeliver 部署 Elixir 应用程序

API

短链接生成 API

bash
## api/shorten curl -X "POST" "http://localhost:4000/api/shorten" \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{ "url": "https://www.github.com" }'

批量短链接生成 API

bash
## Mutil api/shorten curl -X "POST" "http://localhost:4000/api/shorten/" \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{ "url": [ "https://gitlab.com", "https://github.com" ] }'

短链接复原 API

bash
## api/original curl -X "POST" "http://localhost:4000/api/original/" \ -H 'Content-Type: application/json; charset=utf-8' \ -d $'{ "url": "http://localhost:4000/zRa" }'

配置

1、部署地址

2、短链域名

TODO

  • 记录打包、部署、更新测试中的地址

License

MIT

Copyright (c) 2018-present, 小猿大圣(Youthink)

Contributors

Showing top 3 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from imfycc/short_url via the GitHub API.Last fetched: 6/28/2026