Imfycc Short Url Save Abandoned

🔗 short url app elixir Phoenix

Project README

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

调试

进入控制台:

iex -S mix

格式化代码

mix format

部署

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

API

短链接生成 API

## 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

## 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

## 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)

Open Source Agenda is not affiliated with "Imfycc Short Url" Project. README Source: imfycc/short_url

Open Source Agenda Badge

Open Source Agenda Rating