examples/nextjs-cjs/src/pages/index.tsx
import { parseDsn } from '@soluble/dsn-parser';
import type { NextPage } from 'next';
import Head from 'next/head';
import Image from 'next/image';
import styles from '../../styles/Home.module.css';
const Home: NextPage = () => {
const parsedDsn = parseDsn('redis://localhost');
console.log('parseDsn', parsedDsn);
return (
<div className={styles.container}>
<Head>
<title>Example nextjs app (commonjs)</title>
<meta name="description" content="Generated by create next app" />
<link rel="icon" href="/examples/nextjs-cjs/public/favicon.ico" />
</Head>
<main className={styles.main}>
<div>
@soluble/parse-dsn -{' '}
<span>{parsedDsn.success ? 'success' : 'error'}</span>
</div>
</main>
<footer className={styles.footer}>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<span className={styles.logo}>
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
</span>
</a>
</footer>
</div>
);
};
export default Home;