Skip to content

Commit

Permalink
chore: improve insights
Browse files Browse the repository at this point in the history
  • Loading branch information
thuongtruong1009 committed Oct 26, 2023
1 parent 5ec3935 commit 180246c
Show file tree
Hide file tree
Showing 9 changed files with 11,527 additions and 47,609 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This is a simple URL shortener service. It is written in Golang and uses Redis a

## Preview

![](public/preview.png)
![Preview image](public/preview.png)

## What's new

Expand Down Expand Up @@ -54,7 +54,7 @@ git clone https://github.com/thuongtruong1009/short1url.git
cd api && cp .env.example .env

# server
client && cp .env.example .env
cd client && cp .env.example .env
```

3. Run Docker container
Expand All @@ -63,14 +63,13 @@ client && cp .env.example .env
docker-compose up -d
```

4. Open browser
4. Testing API

```bash
http://localhost:81
# with browser
Open http://localhost:81/s
```

4. Testing API

```bash
# with Postman or browser
POST http://localhost:81/s
Expand All @@ -92,7 +91,9 @@ Pull requests are welcome. For major changes, please open an issue first to disc
## License
Short1url is an [MIT-licensed](LICENSE) open source project. Copyright <a href="https://github.com/thuongtruong1009">thuongtruong1009</a>
**Short1url** is an [MIT-licensed](LICENSE) open source project.
Copyright of <a href="https://github.com/thuongtruong1009">thuongtruong1009</a>
<!-- ## References
Expand Down
14 changes: 12 additions & 2 deletions client/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ onMounted(() => {
const getAllShorted = async () => {
const ipData = await FetchMethod(config.public.ipSource);
const allData = await FetchMethod(
`${config.public.apiBase}/all?ip=${ipData.ip}`,
`${config.public.apiBase}/all?ip=${ipData?.ip}`,
{
method: "POST",
}
Expand Down Expand Up @@ -74,7 +74,13 @@ const onClickOptionBtn = (option: EBUTTON_OPTION) => {
/>
<ul>
<li>
<button :disabled="!url" class="short_btn" @click="onShorten">
<button
:disabled="!url"
alt="Shorten"
title="shorten_btn"
class="short_btn"
@click="onShorten"
>
<Link />
<span>Shorten</span>
</button>
Expand All @@ -83,6 +89,8 @@ const onClickOptionBtn = (option: EBUTTON_OPTION) => {
<li>
<button
:disabled="!url"
alt="QR Code"
title="QR Code"
class="qr_btn"
@click="onClickOptionBtn(EBUTTON_OPTION.QRCODE)"
>
Expand All @@ -94,6 +102,8 @@ const onClickOptionBtn = (option: EBUTTON_OPTION) => {
<li>
<button
:disabled="!url"
alt="Bar Code"
title="Bar Code"
class="bar_btn"
@click="onClickOptionBtn(EBUTTON_OPTION.BARCODE)"
>
Expand Down
2 changes: 1 addition & 1 deletion client/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ footer {
color: white;
text-align: center;
padding: 1rem;
font-size: 0.7rem;
font-size: 0.75rem;
}
</style>
12 changes: 12 additions & 0 deletions client/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pkg from "./package.json";
export default defineNuxtConfig({
app: {
head: {
htmlAttrs: { lang: "en", dir: "ltr" },
title: pkg.name,
meta: [
{ charset: "utf-8" },
Expand Down Expand Up @@ -35,6 +36,17 @@ export default defineNuxtConfig({
},
},

modules: [
"@nuxtjs/robots",
[
"@nuxtjs/robots",
{
UserAgent: "*",
Disallow: "/",
},
],
],

runtimeConfig: {
public: {
apiBase: process.env.NUXT_PUBLIC_API_BASE,
Expand Down
Loading

0 comments on commit 180246c

Please sign in to comment.