<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by antd-ts-admin on Medium]]></title>
        <description><![CDATA[Stories by antd-ts-admin on Medium]]></description>
        <link>https://medium.com/@antd-ts-admin?source=rss-29e44e922850------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HjqAkc-95h8WHwQ_fBOMoQ.jpeg</url>
            <title>Stories by antd-ts-admin on Medium</title>
            <link>https://medium.com/@antd-ts-admin?source=rss-29e44e922850------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 15:50:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@antd-ts-admin/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Top 2 ui tailwind components to build nextjs clean ui]]></title>
            <link>https://antd-ts-admin.medium.com/top-2-ui-tailwind-components-to-build-clean-ui-34e1625ac94b?source=rss-29e44e922850------2</link>
            <guid isPermaLink="false">https://medium.com/p/34e1625ac94b</guid>
            <category><![CDATA[tailwind]]></category>
            <category><![CDATA[nextjs]]></category>
            <dc:creator><![CDATA[antd-ts-admin]]></dc:creator>
            <pubDate>Thu, 23 May 2024 01:34:04 GMT</pubDate>
            <atom:updated>2024-05-23T01:35:06.767Z</atom:updated>
            <content:encoded><![CDATA[<ol><li><a href="https://www.hyperui.dev/">https://www.hyperui.dev/</a></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kpMQ-vdzOnrYMYu4I-fnXg.png" /></figure><p>2. <a href="https://magicui.design/">https://magicui.design/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fBZV35T5JdWsjvfj0a-1tA.png" /></figure><p>【Telegram】▶<a href="https://t.me/+z7HU1Ysk7MphYjk1">https://t.me/+z7HU1Ysk7MphYjk1</a><br>【Discord】▶<a href="https://discord.gg/m2tYHA6Y">https://discord.gg/m2tYHA6Y</a><br>【Twitter】▶<a href="https://twitter.com/qiuzhi99pro">https://twitter.com/qiuzhi99pro</a><br>【medium】▶<a href="https://blog.antd-ts-admin.com/">https://blog.antd-ts-admin.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34e1625ac94b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hono Tutorial part 12: how to connect to mongodb database]]></title>
            <link>https://antd-ts-admin.medium.com/hono-tutorial-part-12-how-to-connect-to-mongodb-database-f22cfa7d8efe?source=rss-29e44e922850------2</link>
            <guid isPermaLink="false">https://medium.com/p/f22cfa7d8efe</guid>
            <category><![CDATA[hono]]></category>
            <dc:creator><![CDATA[antd-ts-admin]]></dc:creator>
            <pubDate>Mon, 20 May 2024 09:29:04 GMT</pubDate>
            <atom:updated>2024-05-20T09:29:04.325Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ebSlr8aO3OcaRaEiw9rncw.png" /></figure><p>src/config/db.ts</p><pre>import mongoose, { type ConnectOptions } from &#39;mongoose&#39;;<br><br>const connectDB = async (): Promise&lt;void | null&gt; =&gt; {<br>  try {<br>    // Connect to MongoDB<br>    if (process.env[&#39;MONGODB_URL&#39;] !== undefined) {<br>      const conn = await mongoose.connect(process.env[&#39;MONGODB_URL&#39;], {<br>        // autoIndex: true,<br>        // useNewUrlParser: true,<br>        // useUnifiedTopology: true,<br>      } as ConnectOptions);<br>      console.log(`MongoDB Connected: ${conn.connection.host}`);<br>    }<br>  } catch (error) {<br>    console.log(error);<br>  }<br>};<br><br>export default connectDB;</pre><p>index.ts</p><pre>import { Hono } from &#39;hono&#39;;<br>import { cors } from &#39;hono/cors&#39;;<br>import { logger } from &#39;hono/logger&#39;;<br>import { serveStatic } from &#39;hono/bun&#39;;<br>import type { Context } from &#39;hono&#39;;<br>import { errorHandler } from &#39;./middlewares/errorMiddleware&#39;;<br>import userRoutes from &#39;./routes/userRoutes&#39;;<br>import connectDB from &#39;./config/db&#39;;<br><br>const app = new Hono();<br><br>connectDB();<br><br>// ...<br><br>export default {<br>  port: PORT,<br>  fetch: app.fetch,<br>};</pre><p>.env</p><pre>PORT=5006<br>NODE_ENV=development<br>MONGODB_URL=mongodb://xx:xxx@xxx.xxx.xx.xxx:27017/testdigital</pre><p>【Telegram】▶<a href="https://t.me/+z7HU1Ysk7MphYjk1">https://t.me/+z7HU1Ysk7MphYjk1</a><br>【Discord】▶<a href="https://discord.gg/m2tYHA6Y">https://discord.gg/m2tYHA6Y</a><br>【Twitter】▶<a href="https://twitter.com/qiuzhi99pro">https://twitter.com/qiuzhi99pro</a><br>【medium】▶<a href="https://blog.antd-ts-admin.com/">https://blog.antd-ts-admin.com</a><br>【antd-ts-admin】▶<a href="https://github.com/hfpp2012copy/antd-ts-admin">https://github.com/hfpp2012copy/antd-ts-admin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f22cfa7d8efe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hono Tutorial 11: how to add crud on controllers and routes]]></title>
            <link>https://antd-ts-admin.medium.com/hono-tutorial-11-how-to-add-crud-on-controllers-and-routes-9eb80dd681f0?source=rss-29e44e922850------2</link>
            <guid isPermaLink="false">https://medium.com/p/9eb80dd681f0</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[hono]]></category>
            <dc:creator><![CDATA[antd-ts-admin]]></dc:creator>
            <pubDate>Mon, 20 May 2024 08:44:47 GMT</pubDate>
            <atom:updated>2024-05-20T08:44:47.939Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*451e14ws_tXySaguIyMEPQ.png" /><figcaption>hono</figcaption></figure><p>src/routes/userRoutes.ts</p><pre>import { Hono } from &#39;hono&#39;;<br>import { getUsers, createUser, getUser, updateUser, deleteUser, deleteUsers } from &#39;../controllers/userController&#39;;<br><br>const userRoutes = new Hono()<br>  .get(&#39;/&#39;, getUsers)<br>  .post(&#39;/&#39;, createUser)<br>  .get(&#39;/:id&#39;, getUser)<br>  .put(&#39;/:id&#39;, updateUser)<br>  .delete(&#39;/:id&#39;, deleteUser)<br>  .delete(&#39;/&#39;, deleteUsers);<br><br>export default userRoutes;</pre><p>src/controllers/userController.ts</p><pre>import type { Context } from &#39;hono&#39;;<br><br>export const getUsers = (c: Context) =&gt; {<br>  // TODO: Implement the logic to get users<br>  return c.json({ result: &#39;list authors&#39; });<br>};<br><br>export const createUser = (c: Context) =&gt; {<br>  // TODO: Implement the logic to create a user<br>  return c.json({ result: &#39;create user&#39; });<br>};<br><br>export const getUser = (c: Context) =&gt; {<br>  // TODO: Implement the logic to get a specific user<br>  return c.json({ result: &#39;get user&#39; });<br>};<br><br>export const updateUser = (c: Context) =&gt; {<br>  // TODO: Implement the logic to update a user<br>  return c.json({ result: &#39;update user&#39; });<br>};<br><br>export const deleteUser = (c: Context) =&gt; {<br>  // TODO: Implement the logic to delete a user<br>  return c.json({ result: &#39;delete user&#39; });<br>};<br><br>export const deleteUsers = (c: Context) =&gt; {<br>  // TODO: Implement the logic to delete multiple users<br>  return c.json({ result: &#39;delete users&#39; });<br>};</pre><p>index.ts</p><pre>app.basePath(&#39;/api&#39;).route(&#39;/users&#39;, userRoutes);</pre><p>【Telegram】▶<a href="https://t.me/+z7HU1Ysk7MphYjk1">https://t.me/+z7HU1Ysk7MphYjk1</a><br>【Discord】▶<a href="https://discord.gg/m2tYHA6Y">https://discord.gg/m2tYHA6Y</a><br>【Twitter】▶<a href="https://twitter.com/qiuzhi99pro">https://twitter.com/qiuzhi99pro</a><br>【medium】▶<a href="https://blog.antd-ts-admin.com/">https://blog.antd-ts-admin.com</a><br>【antd-ts-admin】▶<a href="https://github.com/hfpp2012copy/antd-ts-admin">https://github.com/hfpp2012copy/antd-ts-admin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9eb80dd681f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hono Tutorial 10: how to add controllers for hono project]]></title>
            <link>https://antd-ts-admin.medium.com/hono-tutorial-10-how-to-add-controllers-for-hono-project-0f43e12bd605?source=rss-29e44e922850------2</link>
            <guid isPermaLink="false">https://medium.com/p/0f43e12bd605</guid>
            <category><![CDATA[hono]]></category>
            <dc:creator><![CDATA[antd-ts-admin]]></dc:creator>
            <pubDate>Mon, 20 May 2024 08:34:23 GMT</pubDate>
            <atom:updated>2024-05-20T08:34:23.042Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMrKkn1uSup7xBu575rM2A.png" /></figure><p>src/routes/userRoutes.ts</p><pre>import { Hono } from &#39;hono&#39;;<br>import type { Context } from &#39;hono&#39;;<br>import { getUsers } from &#39;../controllers/userController&#39;;<br><br>const userRoutes = new Hono()<br>  .get(&#39;/&#39;, getUsers)<br>  .post(&#39;/&#39;, (c: Context) =&gt; c.json({ result: &#39;create an author&#39; }, 201))<br>  .get(&#39;/:id&#39;, (c: Context) =&gt; c.json({ result: `get ${c.req.param(&#39;id&#39;)}` }));<br><br>export default userRoutes;</pre><p>getUsers is my new added function.</p><p>src/controllers/userController.ts</p><pre>import type { Context } from &#39;hono&#39;;<br><br>export const getUsers = (c: Context) =&gt; {<br>  return c.json({ result: &#39;list authors&#39; })<br>}</pre><p>【Telegram】▶<a href="https://t.me/+z7HU1Ysk7MphYjk1">https://t.me/+z7HU1Ysk7MphYjk1</a><br>【Discord】▶<a href="https://discord.gg/m2tYHA6Y">https://discord.gg/m2tYHA6Y</a><br>【Twitter】▶<a href="https://twitter.com/qiuzhi99pro">https://twitter.com/qiuzhi99pro</a><br>【medium】▶<a href="https://blog.antd-ts-admin.com/">https://blog.antd-ts-admin.com</a><br>【antd-ts-admin】▶<a href="https://github.com/hfpp2012copy/antd-ts-admin">https://github.com/hfpp2012copy/antd-ts-admin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0f43e12bd605" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hono Tutorial part 9: how to add routes prefix]]></title>
            <link>https://antd-ts-admin.medium.com/hono-tutorial-part-9-how-to-add-routes-prefix-631b1e4e55b2?source=rss-29e44e922850------2</link>
            <guid isPermaLink="false">https://medium.com/p/631b1e4e55b2</guid>
            <category><![CDATA[hono]]></category>
            <dc:creator><![CDATA[antd-ts-admin]]></dc:creator>
            <pubDate>Mon, 20 May 2024 08:26:32 GMT</pubDate>
            <atom:updated>2024-05-20T08:26:32.762Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2CBjQ8EH15DvMnd3CxC8WQ.png" /></figure><pre>app.basePath(&#39;/api&#39;).route(&#39;/users&#39;, userRoutes);</pre><p>just add basePath function to the app object.</p><p>complete code:</p><pre>import { Hono } from &#39;hono&#39;;<br>import { cors } from &#39;hono/cors&#39;;<br>import { logger } from &#39;hono/logger&#39;;<br>import { config } from &#39;dotenv&#39;;<br>import { serveStatic } from &#39;hono/bun&#39;;<br>import type { Context } from &#39;hono&#39;;<br>import { errorHandler } from &#39;./middlewares/errorMiddleware&#39;;<br>import userRoutes from &#39;./routes/userRoutes&#39;;<br><br>config();<br><br>const app = new Hono();<br><br>app.use(logger());<br>app.get(<br>  &#39;/api/static/*&#39;,<br>  serveStatic({<br>    root: &#39;./&#39;,<br>    rewriteRequestPath: (path) =&gt; path.replace(/^\/api/, &#39;/&#39;),<br>  }),<br>);<br><br>app.use(&#39;/api/*&#39;, cors());<br><br>app.get(&#39;/&#39;, (c: Context) =&gt; {<br>  return c.text(&#39;API is running...ok&#39;);<br>});<br><br>app.basePath(&#39;/api&#39;).route(&#39;/users&#39;, userRoutes);<br><br>const PORT: string | number = process.env.PORT || 5000;<br><br>errorHandler(app);<br><br>export default {<br>  port: PORT,<br>  fetch: app.fetch,<br>};</pre><p>【Telegram】▶<a href="https://t.me/+z7HU1Ysk7MphYjk1">https://t.me/+z7HU1Ysk7MphYjk1</a><br>【Discord】▶<a href="https://discord.gg/m2tYHA6Y">https://discord.gg/m2tYHA6Y</a><br>【Twitter】▶<a href="https://twitter.com/qiuzhi99pro">https://twitter.com/qiuzhi99pro</a><br>【medium】▶<a href="https://blog.antd-ts-admin.com/">https://blog.antd-ts-admin.com</a><br>【antd-ts-admin】▶<a href="https://github.com/hfpp2012copy/antd-ts-admin">https://github.com/hfpp2012copy/antd-ts-admin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=631b1e4e55b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hono Tutorial part 8: how to split routes to multiple files]]></title>
            <link>https://antd-ts-admin.medium.com/hono-tutorail-part-6-how-to-split-routes-to-multiple-files-9516c5dc3719?source=rss-29e44e922850------2</link>
            <guid isPermaLink="false">https://medium.com/p/9516c5dc3719</guid>
            <category><![CDATA[hono]]></category>
            <dc:creator><![CDATA[antd-ts-admin]]></dc:creator>
            <pubDate>Mon, 20 May 2024 08:18:19 GMT</pubDate>
            <atom:updated>2024-05-20T08:22:31.990Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UC6iTteB4GBfpHVMBDZKrA.png" /></figure><p>I want to split routes to multiple files.</p><pre>import { Hono } from &#39;hono&#39;;<br>import { cors } from &#39;hono/cors&#39;;<br>import { logger } from &#39;hono/logger&#39;;<br>import { config } from &#39;dotenv&#39;;<br>import { serveStatic } from &#39;hono/bun&#39;;<br>import type { Context } from &#39;hono&#39;;<br>import { errorHandler } from &#39;./middlewares/errorMiddleware&#39;;<br>import userRoutes from &#39;./routes/userRoutes&#39;; // the route file<br><br>// ...<br>app.route(&#39;/users&#39;, userRoutes)<br>// and also add other files<br><br>export default {<br>  port: PORT,<br>  fetch: app.fetch,<br>};</pre><p>src/routes/userRoutes.ts</p><pre>import { Hono } from &#39;hono&#39;<br>import type { Context } from &#39;hono&#39;;<br><br>const userRoutes = new Hono()<br>  .get(&#39;/&#39;, (c: Context) =&gt; c.json({ result: &#39;list authors&#39; }))<br>  .post(&#39;/&#39;, (c: Context) =&gt; c.json({ result: &#39;create an author&#39; }, 201))<br>  .get(&#39;/:id&#39;, (c: Context) =&gt; c.json({ result: `get ${c.req.param(&#39;id&#39;)}` }))<br>  <br>export default userRoutes</pre><p>【Telegram】▶<a href="https://t.me/+z7HU1Ysk7MphYjk1">https://t.me/+z7HU1Ysk7MphYjk1</a><br>【Discord】▶<a href="https://discord.gg/m2tYHA6Y">https://discord.gg/m2tYHA6Y</a><br>【Twitter】▶<a href="https://twitter.com/qiuzhi99pro">https://twitter.com/qiuzhi99pro</a><br>【medium】▶<a href="https://blog.antd-ts-admin.com/">https://blog.antd-ts-admin.com</a><br>【antd-ts-admin】▶<a href="https://github.com/hfpp2012copy/antd-ts-admin">https://github.com/hfpp2012copy/antd-ts-admin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9516c5dc3719" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hono Tutorial part 7 bun with hono create my custom middleware]]></title>
            <link>https://antd-ts-admin.medium.com/bun-with-hono-create-my-custom-middleware-2b1370121757?source=rss-29e44e922850------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b1370121757</guid>
            <category><![CDATA[hono]]></category>
            <dc:creator><![CDATA[antd-ts-admin]]></dc:creator>
            <pubDate>Mon, 20 May 2024 08:13:32 GMT</pubDate>
            <atom:updated>2024-05-20T08:22:14.520Z</atom:updated>
            <content:encoded><![CDATA[<p>src/middlewares/errorMiddleware.ts</p><pre>import type { Hono } from &#39;hono&#39;;<br>import type { Context } from &#39;hono&#39;;<br><br>export const errorHandler = (app: Hono) =&gt; {<br>  app.notFound((c: Context) =&gt; {<br>    return c.json(<br>      {<br>        success: false,<br>        message: &#39;Not Found - &#39; + c.req.url,<br>      },<br>      404,<br>    );<br>  });<br><br>  app.onError((err: Error, c: Context) =&gt; {<br>    return c.json(<br>      {<br>        success: false,<br>        message: err.message,<br>        error: err,<br>        stack: process.env.NODE_ENV === &#39;production&#39; ? null : err.stack,<br>      },<br>      500,<br>    );<br>  });<br>};</pre><p>how to use the middleware</p><pre>import { Hono } from &#39;hono&#39;;<br>import { cors } from &#39;hono/cors&#39;;<br>import { logger } from &#39;hono/logger&#39;;<br>import { config } from &#39;dotenv&#39;;<br>import { serveStatic } from &#39;hono/bun&#39;;<br>import type { Context } from &#39;hono&#39;;<br>import { errorHandler } from &#39;./middlewares/errorMiddleware&#39;;<br>import userRoutes from &#39;./routes/userRoutes&#39;;<br><br>// ....<br><br>errorHandler(app); // this line<br><br>export default {<br>  port: PORT,<br>  fetch: app.fetch,<br>};</pre><p>hope it helps you.</p><p>【Telegram】▶<a href="https://t.me/+z7HU1Ysk7MphYjk1">https://t.me/+z7HU1Ysk7MphYjk1</a><br>【Discord】▶<a href="https://discord.gg/m2tYHA6Y">https://discord.gg/m2tYHA6Y</a><br>【Twitter】▶<a href="https://twitter.com/qiuzhi99pro">https://twitter.com/qiuzhi99pro</a><br>【medium】▶<a href="https://blog.antd-ts-admin.com/">https://blog.antd-ts-admin.com</a><br>【antd-ts-admin】▶<a href="https://github.com/hfpp2012copy/antd-ts-admin">https://github.com/hfpp2012copy/antd-ts-admin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b1370121757" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hono Tutorial part 6 bun and hono integrate husky hook and prettier and lint-staged to auto format…]]></title>
            <link>https://antd-ts-admin.medium.com/bun-and-hono-integrate-husky-hook-and-prettier-and-lint-staged-to-auto-format-code-4ff51df9adab?source=rss-29e44e922850------2</link>
            <guid isPermaLink="false">https://medium.com/p/4ff51df9adab</guid>
            <category><![CDATA[hono]]></category>
            <dc:creator><![CDATA[antd-ts-admin]]></dc:creator>
            <pubDate>Mon, 20 May 2024 07:19:54 GMT</pubDate>
            <atom:updated>2024-05-20T08:21:50.655Z</atom:updated>
            <content:encoded><![CDATA[<h3>Hono Tutorial part 6 bun and hono integrate husky hook and prettier and lint-staged to auto format code</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xjiplvGOaRWWTXTWGFow3A.png" /></figure><ol><li>first install <a href="https://typicode.github.io/husky/get-started.html">https://typicode.github.io/husky/get-started.html</a></li></ol><pre>bun add --dev husky</pre><pre>bunx husky init</pre><pre> echo &quot;npm run lint-staged&quot; &gt; .husky/pre-commit</pre><p>2. second install <a href="https://github.com/lint-staged/lint-staged">https://github.com/lint-staged/lint-staged</a></p><pre>bun add lint-staged -D</pre><pre>{<br>  &quot;scripts&quot;: {<br>    &quot;dev&quot;: &quot;bun run --hot src/index.ts&quot;,<br>    &quot;start&quot;: &quot;bun run src/index.ts&quot;,<br>    &quot;prepare&quot;: &quot;husky&quot;,<br>    &quot;lint-staged&quot;: &quot;lint-staged&quot;<br>  },<br>  &quot;lint-staged&quot;: {<br>    &quot;**/*.{js,ts,less,md,json}&quot;: [<br>      &quot;prettier --write&quot;<br>    ]<br>  },<br>  &quot;dependencies&quot;: {<br>    &quot;dotenv&quot;: &quot;^16.4.5&quot;,<br>    &quot;hono&quot;: &quot;^4.3.7&quot;<br>  },<br>  &quot;devDependencies&quot;: {<br>    &quot;@types/bun&quot;: &quot;latest&quot;,<br>    &quot;@types/dotenv&quot;: &quot;^8.2.0&quot;,<br>    &quot;husky&quot;: &quot;^9.0.11&quot;,<br>    &quot;lint-staged&quot;: &quot;^15.2.2&quot;,<br>    &quot;prettier&quot;: &quot;^3.2.5&quot;<br>  }<br>}</pre><p>last, install prettier</p><p>bun add — dev prettier</p><pre># .prettierrc<br>{<br>  &quot;singleQuote&quot;: true,<br>  &quot;trailingComma&quot;: &quot;all&quot;,<br>  &quot;overrides&quot;: [<br>    {<br>      &quot;files&quot;: [&quot;*.ts&quot;, &quot;*.mts&quot;],<br>      &quot;options&quot;: {<br>        &quot;parser&quot;: &quot;typescript&quot;<br>      }<br>    }<br>  ]<br>}</pre><p>Hope it helps you</p><p>【Telegram】▶<a href="https://t.me/+z7HU1Ysk7MphYjk1">https://t.me/+z7HU1Ysk7MphYjk1</a><br>【Discord】▶<a href="https://discord.gg/m2tYHA6Y">https://discord.gg/m2tYHA6Y</a><br>【Twitter】▶<a href="https://twitter.com/qiuzhi99pro">https://twitter.com/qiuzhi99pro</a><br>【medium】▶<a href="https://blog.antd-ts-admin.com/">https://blog.antd-ts-admin.com</a><br>【antd-ts-admin】▶<a href="https://github.com/hfpp2012copy/antd-ts-admin">https://github.com/hfpp2012copy/antd-ts-admin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4ff51df9adab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hono Tutorial part 5 How to use cors with bun and hono project]]></title>
            <link>https://antd-ts-admin.medium.com/how-to-use-cors-with-bun-and-hono-project-5348cf4d5d50?source=rss-29e44e922850------2</link>
            <guid isPermaLink="false">https://medium.com/p/5348cf4d5d50</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[hono]]></category>
            <dc:creator><![CDATA[antd-ts-admin]]></dc:creator>
            <pubDate>Mon, 20 May 2024 06:35:09 GMT</pubDate>
            <atom:updated>2024-05-20T08:21:33.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f4ZyOilIA1l28GD6iUoMIw.png" /></figure><p>first, just import the cors package.</p><pre>import { cors } from &#39;hono/cors&#39;</pre><p>second, use it on my api path.</p><pre>app.use(&#39;/api/*&#39;, cors())</pre><p>that it.</p><p>【Telegram】▶<a href="https://t.me/+z7HU1Ysk7MphYjk1">https://t.me/+z7HU1Ysk7MphYjk1</a><br>【Shopify 真实案例技术赚钱营销课视频教程】▶<a href="https://qiuzhi99.com/playlists/shopify.html">https://qiuzhi99.com/playlists/shopify.html</a><br>【Paypal】▶<a href="https://www.paypal.com/paypalme/rails365">https://www.paypal.com/paypalme/rails365</a><br>【B 站】▶<a href="https://space.bilibili.com/31152817">https://space.bilibili.com/31152817</a><br>【Discord】▶<a href="https://discord.gg/m2tYHA6Y">https://discord.gg/m2tYHA6Y</a><br>【Twitter】▶<a href="https://twitter.com/qiuzhi99pro">https://twitter.com/qiuzhi99pro</a><br>【medium】▶<a href="https://blog.antd-ts-admin.com/">https://blog.antd-ts-admin.com</a><br>【antd-ts-admin】▶<a href="https://github.com/hfpp2012copy/antd-ts-admin">https://github.com/hfpp2012copy/antd-ts-admin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5348cf4d5d50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hono Tutorial part 4 how to Serve static files in bun with hono]]></title>
            <link>https://antd-ts-admin.medium.com/how-to-serve-static-files-in-bun-with-hono-c9ee592afdd3?source=rss-29e44e922850------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9ee592afdd3</guid>
            <category><![CDATA[hono]]></category>
            <category><![CDATA[bűn]]></category>
            <dc:creator><![CDATA[antd-ts-admin]]></dc:creator>
            <pubDate>Mon, 20 May 2024 06:32:50 GMT</pubDate>
            <atom:updated>2024-05-20T08:21:06.061Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x11Z2QRiwqyZ5vE_sSLk0Q.png" /></figure><p>I want to serve static files(templates) to frontend.</p><p>the doc is here: <a href="https://hono.dev/getting-started/bun#serve-static-files">https://hono.dev/getting-started/bun#serve-static-files</a></p><p>but i change it to suits me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0nejGkuxGZ5C81UqpqNA_Q.png" /></figure><p>the all code:</p><pre>import { Hono } from &#39;hono&#39;<br>import { cors } from &#39;hono/cors&#39;<br>import { logger } from &#39;hono/logger&#39;<br>import { config } from &#39;dotenv&#39;;<br>import { serveStatic } from &#39;hono/bun&#39;<br><br>config();<br><br>const app = new Hono()<br><br>app.use(logger())<br>app.get(<br>  &#39;/api/static/*&#39;,<br>  serveStatic({<br>    root: &#39;./&#39;,<br>    rewriteRequestPath: (path) =&gt; path.replace(/^\/api/, &#39;/&#39;),<br>  })<br>)<br><br>app.use(&#39;/api/*&#39;, cors())<br><br>app.get(&#39;/&#39;, (c) =&gt; {<br>  return c.text(&#39;API is running...ok&#39;)<br>})<br><br><br><br>const PORT: string | number = process.env.PORT || 5000;<br><br><br>app.notFound(c =&gt; {<br>  return c.json({ <br>    success: false,<br>    message: &#39;Not Found - &#39; + c.req.url<br>  }, 404)<br>});<br><br>app.onError((err, c) =&gt; {<br>  return c.json({ <br>    success: false,<br>    message: err.message,<br>    error: err,<br>    stack: process.env.NODE_ENV === &#39;production&#39; ? null : err.stack<br>  }, 500)<br>});<br><br>export default { <br>  port: PORT, <br>  fetch: app.fetch, <br>}</pre><p>and the directory:</p><pre>.<br>├── README.md<br>├── bun.lockb<br>├── package.json<br>├── pnpm-lock.yaml<br>├── src<br>│   └── index.ts<br>├── static<br>│   └── testfile.txt<br>├── tsconfig.json<br>└── tsconfig.release.json</pre><p>hope it helper to you.</p><p>my open source project: <a href="https://github.com/hfpp2012copy/antd-ts-admin">https://github.com/hfpp2012copy/antd-ts-admin</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9ee592afdd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>