View routing-in-next-link.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Link from "next/link"; | |
function UserList({ users }) { | |
return ( | |
<ul> | |
{users.map((user) => ( | |
<li key={user.id}> | |
<Link href="/users/[slug]" as={`/users/${user.slug}`}> | |
<a>{user.name}</a> | |
</Link> |
View nextjs-rout-url.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function UserProfile({ user }) { | |
return ( | |
<div> | |
<h1>{user.name}</h1> | |
<p>{user.bio}</p> | |
</div> | |
); | |
} | |
export async function getServerSideProps(context) { |
View dynamic-routes.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRouter } from "next/router"; | |
function UserProfile() { | |
const router = useRouter(); | |
const { id } = router.query; | |
// Fetch data for user with id | |
... | |
return ( |
View routing-nextjs.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function UserProfile({ user }) { | |
return ( | |
<div> | |
<h1>{user.name}</h1> | |
<p>{user.bio}</p> | |
</div> | |
); | |
} | |
export async function getServerSideProps(context) { |
View ssrpost3.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
const About = ({ data }) => { | |
return ( | |
<div> | |
<h1>About Our App</h1> | |
<p>Our app is the best thing since sliced bread.</p> | |
<p>Data from API: {data}</p> | |
</div> | |
) |
View ssrpost2.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Link from 'next/link' | |
const Home = () => { | |
return ( | |
<div> | |
<Link href="/about"> | |
<a>About</a> | |
</Link> | |
</div> | |
) |
View ssrpost1.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
const About = () => { | |
return ( | |
<div> | |
<h1>About Our App</h1> | |
<p>Our app is the best thing since sliced bread.</p> | |
</div> | |
) | |
} |
View equality.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use strict equality when comparing variables of the same type | |
let age = 25; | |
let legalAge = 21; | |
console.log(age === legalAge); // false | |
// Use loose equality when comparing variables that may be a string or a number | |
let input = "25"; | |
let number = 25; | |
console.log(input == number); // true |
View disallowed-comment-keys.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Amoxicillin | |
insurance companies | |
cashless society | |
Viagra | |
Zithromax | |
.net | |
.org | |
.com | |
mewkid.net | |
mewkid |
View .htaccess
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine On | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
NewerOlder