Skip to content

Commit

Permalink
feat: support pwa app (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmh-program committed Aug 6, 2024
1 parent d098dae commit 3e72fc2
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ No need to say more, just try it out! 🥳
1.**Pretty UI**: Modern design with [Shadcn UI](https://ui.shadcn.com), make you feel comfortable.
2. 📱 **Responsive**: Works well on Mobile✅ / Tablet✅ / Desktop✅.
3. 🌈 **Multi Theme**: Multi theme support (*Light & Dark*), system theme detection, switch theme as you like.
4. 🚀 **Fast Query**: Powered by Next.js, support serverless deployment.
4. 🚀 **Flexible Query**: Powered by Next.js, support serverless deployment and fast query.
5. 📚 **Record History**: History records are stored in local storage, easy to view and query history.
6. 📡 **Open API**: Simple API for whois query, easy to integrate with other services.
7. 🌍 **IPv4 & IPv6 Whois**: Support IPv4 & IPv6 whois query.
7. 🌍 **IPv4 & IPv6 Whois**: Support IPv4, IPv6, Domain, ASN, CIDR whois query.
8. 📦 **Result Capture**: Capture whois result, easy to share and save.
9. 📡 **Whois Cache**: Support whois cache based on Redis, improve query speed.
10. 🌍 [WIP] **Internationalization**: Support multiple languages. ([#6](https://github.com/zmh-program/next-whois-ui/issues/6))
Expand Down
27 changes: 26 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
/** @type {import('next').NextConfig} */

import setupPWA from 'next-pwa';

const nextConfig = {
reactStrictMode: true,
};

export default nextConfig;
const withPWA = setupPWA({
dest: 'public',
disable: process.env.NODE_ENV === 'development',
register: true,
skipWaiting: true,
buildExcludes: [/manifest\.json$/, /_next\/data/, /_next\/static/],
runtimeCaching: [
// cache *.css, *.js, *.woff2 files
{
urlPattern: /^https?.*\.(css|js|woff2)$/,
handler: 'CacheFirst',
options: {
cacheName: 'assets-cache',
expiration: {
maxEntries: 200,
maxAgeSeconds: 7 * 24 * 60 * 60, // 7 days
},
}
},
],
});

export default withPWA(nextConfig);
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next-whois-ui",
"version": "0.2.0",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
Empty file added public/sw.js
Empty file.
2 changes: 1 addition & 1 deletion src/lib/env.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const VERSION = "0.2.0";
export const VERSION = "0.3.0";

export const HISTORY_LIMIT: number = intEnv("NEXT_PUBLIC_HISTORY_LIMIT", 6);
// The maximum number of history items to keep in the local storage
Expand Down

0 comments on commit 3e72fc2

Please sign in to comment.