Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:01,599 --> 00:00:05,839
next let's take a look at another
2
00:00:03,840 --> 00:00:08,080
benefit of next.js
3
00:00:05,839 --> 00:00:10,240
now that we know more about different
4
00:00:08,080 --> 00:00:14,400
rendering techniques and performance
5
00:00:10,240 --> 00:00:17,680
let's dive into file based routing
6
00:00:14,400 --> 00:00:20,880
so what exactly is file based routing
7
00:00:17,680 --> 00:00:22,240
next yes has an intuitive file based
8
00:00:20,880 --> 00:00:25,840
routing system
9
00:00:22,240 --> 00:00:28,720
now this image right here is an example
10
00:00:25,840 --> 00:00:30,880
of a nextgs project
11
00:00:28,720 --> 00:00:33,280
every next year's project
12
00:00:30,880 --> 00:00:36,239
create next app which is essentially a
13
00:00:33,280 --> 00:00:38,160
package that nextgs provides to create
14
00:00:36,239 --> 00:00:41,440
next year's applications
15
00:00:38,160 --> 00:00:43,440
every nexgs app consists of a pages
16
00:00:41,440 --> 00:00:44,640
directory it comes with a pages
17
00:00:43,440 --> 00:00:46,879
directory
18
00:00:44,640 --> 00:00:49,520
the minute you create a new file under
19
00:00:46,879 --> 00:00:53,039
the pages directory you automatically
20
00:00:49,520 --> 00:00:54,800
have a route so for example index.js
21
00:00:53,039 --> 00:00:55,920
will route to slash
22
00:00:54,800 --> 00:01:00,559
whereas
23
00:00:55,920 --> 00:01:01,760
api and hello.js will route to slash api
24
00:01:00,559 --> 00:01:03,520
hello
25
00:01:01,760 --> 00:01:05,519
now you don't need to worry about
26
00:01:03,520 --> 00:01:07,840
installing an additional package
27
00:01:05,519 --> 00:01:10,400
something like react router that you
28
00:01:07,840 --> 00:01:14,000
would in create react app now create
29
00:01:10,400 --> 00:01:15,360
react app always needs this additional
30
00:01:14,000 --> 00:01:18,320
setup
31
00:01:15,360 --> 00:01:21,840
you need some sort of a router on top of
32
00:01:18,320 --> 00:01:23,360
create react app for routing to be much
33
00:01:21,840 --> 00:01:26,000
easier
34
00:01:23,360 --> 00:01:27,600
but with nextgs you get this out of the
35
00:01:26,000 --> 00:01:31,119
box
36
00:01:27,600 --> 00:01:33,439
next yes comes with its own opinionated
37
00:01:31,119 --> 00:01:36,240
file based routing system
38
00:01:33,439 --> 00:01:39,200
now this specific pages directory also
39
00:01:36,240 --> 00:01:41,520
has support for dynamic routes as well
40
00:01:39,200 --> 00:01:43,920
and we will take a look at all the
41
00:01:41,520 --> 00:01:46,000
different ways we can create routes
42
00:01:43,920 --> 00:01:48,640
later in the course we have a separate
43
00:01:46,000 --> 00:01:52,000
section dedicated to that
44
00:01:48,640 --> 00:01:54,479
now another advantage of using next
45
00:01:52,000 --> 00:01:56,399
year's routing system is that it also
46
00:01:54,479 --> 00:01:58,880
helps with performance
47
00:01:56,399 --> 00:02:01,280
and you might be wondering how
48
00:01:58,880 --> 00:02:04,079
well if you go to a specific route in
49
00:02:01,280 --> 00:02:06,799
next.js with automatic code splitting
50
00:02:04,079 --> 00:02:08,959
that we took a look at already nextgs is
51
00:02:06,799 --> 00:02:11,599
only going to load that route and
52
00:02:08,959 --> 00:02:14,000
resources needed for that route
53
00:02:11,599 --> 00:02:17,040
and if you share a bunch of code between
54
00:02:14,000 --> 00:02:20,720
routes next yes also abstract that out
55
00:02:17,040 --> 00:02:23,760
into chunks that we already saw as well
56
00:02:20,720 --> 00:02:25,840
so this file based routing system is
57
00:02:23,760 --> 00:02:29,120
incredibly useful because you don't need
58
00:02:25,840 --> 00:02:32,239
to set up anything from scratch
59
00:02:29,120 --> 00:02:35,599
now nextgs also has the specific api
60
00:02:32,239 --> 00:02:37,440
folder an api folder hosts all the
61
00:02:35,599 --> 00:02:40,160
back-end logic
62
00:02:37,440 --> 00:02:42,000
all the server-side code of our project
63
00:02:40,160 --> 00:02:45,040
now any route that you create inside the
64
00:02:42,000 --> 00:02:46,640
api folder is essentially a server-side
65
00:02:45,040 --> 00:02:48,640
route
66
00:02:46,640 --> 00:02:50,879
now we will take a look at all of that
67
00:02:48,640 --> 00:02:52,959
later in the course but
68
00:02:50,879 --> 00:02:56,319
isn't file based routing system that
69
00:02:52,959 --> 00:02:58,800
next year's provide really cool
70
00:02:56,319 --> 00:03:00,959
it comes out of the box and it's
71
00:02:58,800 --> 00:03:02,560
completely free
72
00:03:00,959 --> 00:03:04,879
all right so now that we learned about
73
00:03:02,560 --> 00:03:07,120
file based routing system next let's
74
00:03:04,879 --> 00:03:08,000
take a look at seo
75
00:03:07,120 --> 00:03:10,720
so
76
00:03:08,000 --> 00:03:14,080
what exactly is seo
77
00:03:10,720 --> 00:03:16,640
it is another popular benefit of next.js
78
00:03:14,080 --> 00:03:19,280
now one of the most popular reasons for
79
00:03:16,640 --> 00:03:22,319
using next.js is seo
80
00:03:19,280 --> 00:03:24,560
and what is seo exactly
81
00:03:22,319 --> 00:03:26,560
seo stands for search engine
82
00:03:24,560 --> 00:03:29,040
optimization
83
00:03:26,560 --> 00:03:31,200
seo is essentially a language for the
84
00:03:29,040 --> 00:03:33,519
bots
85
00:03:31,200 --> 00:03:36,239
now if you configure your web app to
86
00:03:33,519 --> 00:03:39,599
have specific properties such as have
87
00:03:36,239 --> 00:03:41,280
proper titles metadata that becomes the
88
00:03:39,599 --> 00:03:43,360
language
89
00:03:41,280 --> 00:03:45,920
of your web app to communicate to the
90
00:03:43,360 --> 00:03:49,680
bots so that you're making the life of
91
00:03:45,920 --> 00:03:52,319
bots easier to discover your content
92
00:03:49,680 --> 00:03:54,319
so let's take a look at an example
93
00:03:52,319 --> 00:03:56,560
now when you essentially go ahead and
94
00:03:54,319 --> 00:03:58,239
publish your site or you deploy your
95
00:03:56,560 --> 00:04:00,560
site right
96
00:03:58,239 --> 00:04:03,120
then a bot is going to go ahead and
97
00:04:00,560 --> 00:04:04,400
crawl your specific page as it discovers
98
00:04:03,120 --> 00:04:06,159
it
99
00:04:04,400 --> 00:04:09,120
once it crawls your page it's going to
100
00:04:06,159 --> 00:04:11,280
find all the content on that page
101
00:04:09,120 --> 00:04:13,439
then it is going to try and understand
102
00:04:11,280 --> 00:04:15,200
what the specific page is about
103
00:04:13,439 --> 00:04:17,040
and the way it's going to understand is
104
00:04:15,200 --> 00:04:19,280
by making sure that you have a page
105
00:04:17,040 --> 00:04:21,440
title you have a proper description in
106
00:04:19,280 --> 00:04:24,560
your site you have you are basically
107
00:04:21,440 --> 00:04:27,199
using all proper html semantics as well
108
00:04:24,560 --> 00:04:29,840
so that bot can easily understand that
109
00:04:27,199 --> 00:04:32,800
is the language of the bot
110
00:04:29,840 --> 00:04:33,759
just like you and i are communicating in
111
00:04:32,800 --> 00:04:37,280
english
112
00:04:33,759 --> 00:04:40,320
bot uses html syntax to essentially
113
00:04:37,280 --> 00:04:42,080
understand what your page is all about
114
00:04:40,320 --> 00:04:44,320
now once it fully understand what this
115
00:04:42,080 --> 00:04:46,240
specific page is about based on what you
116
00:04:44,320 --> 00:04:49,520
have described in your page it will go
117
00:04:46,240 --> 00:04:52,080
ahead and rank your page on google
118
00:04:49,520 --> 00:04:54,240
compared to all the different sites it
119
00:04:52,080 --> 00:04:56,800
is going to go ahead and then assign a
120
00:04:54,240 --> 00:04:59,280
rank to your specific website
121
00:04:56,800 --> 00:05:02,560
now you definitely want a higher rank
122
00:04:59,280 --> 00:05:04,960
because if your rank is low then on
123
00:05:02,560 --> 00:05:07,360
google people are not going to go ahead
124
00:05:04,960 --> 00:05:10,080
and discover your specific site
125
00:05:07,360 --> 00:05:12,800
you want to make the lives of bot easy
126
00:05:10,080 --> 00:05:14,400
to discover your content and you can do
127
00:05:12,800 --> 00:05:17,759
that by making sure you're following
128
00:05:14,400 --> 00:05:20,960
semantics and many other things
129
00:05:17,759 --> 00:05:23,520
now seo is a really complex topic and we
130
00:05:20,960 --> 00:05:25,120
will learn all about seo later in the
131
00:05:23,520 --> 00:05:28,160
course
132
00:05:25,120 --> 00:05:30,960
nextgs allows you the ability to add a
133
00:05:28,160 --> 00:05:33,440
seo easily to your site without adding
134
00:05:30,960 --> 00:05:35,759
any specific package
135
00:05:33,440 --> 00:05:38,400
next yes provides us with a few
136
00:05:35,759 --> 00:05:40,400
components out of the box just like the
137
00:05:38,400 --> 00:05:42,479
next image component
138
00:05:40,400 --> 00:05:45,520
next js provides us with the next head
139
00:05:42,479 --> 00:05:48,080
component that allows us to update the
140
00:05:45,520 --> 00:05:50,960
title of every single page in an
141
00:05:48,080 --> 00:05:53,199
application as well and it has a lot of
142
00:05:50,960 --> 00:05:54,720
features
143
00:05:53,199 --> 00:05:55,840
and we are just scratching the surface
144
00:05:54,720 --> 00:05:57,600
here
145
00:05:55,840 --> 00:06:01,120
so we will learn
146
00:05:57,600 --> 00:06:02,560
a lot about seo later in the course
147
00:06:01,120 --> 00:06:06,160
but for now
148
00:06:02,560 --> 00:06:11,400
let's take a look at the next benefit of
149
00:06:06,160 --> 00:06:11,400
next.js and that is serverless functions
10425
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.