aboutsummaryrefslogtreecommitdiff
path: root/files/pt-pt/learn/server-side/express_nodejs/index.html
blob: 1c7e7413ec7c92e36340ffb19ef0b0c1191373d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
title: Framework da Web Express (Node.js/JavaScript)
slug: Learn/No-servidor/Express_Nodejs
tags:
  - Aprender
  - CodingScripting
  - Express
  - Express.js
  - Introdução
  - JavaScript
  - Node
  - Nodo
  - Principiante
  - Programação no lado do servidor
  - node.js
translation_of: Learn/Server-side/Express_Nodejs
---
<div>{{LearnSidebar}}</div>

<p class="summary">Express é uma das frameworks mais populares, escrita em JavaScript e hospedada dentro do próprio ambiente de execução node.js. Este módulo explica alguns dos benefícios chave desta framework, como configurar o seu ambiente de desenvolvimento e como realizar tarefas comuns de desenvolvimento da <em>web</em> e tarefas de implementação.</p>

<h2 id="Pré-requisitos"><span class="short_text" id="result_box" lang="pt"><span>Pré-requisitos</span></span></h2>

<p>Antes de iniciar este módulo, você precisará entender o que são os programas da web e do lado do servidor, idealmente lendo os tópicos no nosso módulo <a href="/pt-PT/docs/Learn/No-servidor/Primeiros_passos">Os primeiros passos de programação do sites da Web no lado do servidor</a>. Um conhecimento geral de conceitos de programação e JavaScript é altamente recomendado, mas não essencial para compreender os conceitos fundamentais.</p>

<div class="note">
<p><strong>Nota</strong>: This website has many useful resources for learning JavaScript<em> in the context of client-side development</em>: <a href="/en-US/docs/Web/JavaScript">JavaScript</a><a href="/en-US/docs/Web/JavaScript/Guide">JavaScript Guide</a>, <a href="/en-US/docs/Learn/Getting_started_with_the_web/JavaScript_basics">JavaScript Basics</a><a href="/en-US/docs/Learn/JavaScript">JavaScript</a> (learning). The core JavaScript language and concepts are the same for server-side development on Node.js and this material will be relevant. Node.js offers <a href="https://nodejs.org/dist/latest-v6.x/docs/api/">additional APIs</a> for supporting functionality that is useful in browserless environments, e.g. to create HTTP servers and access the file system, but does not support JavaScript APIs for working with the browser and DOM.</p>

<p>This guide will provide some information about working with Node.js and Express, and there are numerous other excellent resources on the Internet and in books — some of these linked from <a href="http://stackoverflow.com/a/5511507/894359">How do I get started with Node.js</a> (StackOverflow) and <a href="https://www.quora.com/What-are-the-best-resources-for-learning-Node-js?">What are the best resources for learning Node.js?</a> (Quora).</p>
</div>

<h2 id="Guias">Guias</h2>

<dl>
 <dt><a href="/pt-PT/docs/Learn/No-servidor/Express_Nodejs/Introduction">Introdução a Express/Node</a></dt>
 <dd>In this first Express article we answer the questions "What is Node?" and "What is Express?" and give you an overview of what makes the Express web framework special. We'll outline the main features, and show you some of the main building blocks of an Express application (although at this point you won't yet have a development environment in which to test it).</dd>
 <dt><a href="/pt-PT/docs/Learn/No-servidor/Express_Nodejs/Configurar_um_meio_de_desenvolvimento_Node">Configurar um ambiente de desenvolvimento Node (Express)</a></dt>
 <dd>Now that you know what Express is for, we'll show you how to set up and test a Node/Express development environment on Windows, Linux (Ubuntu), and Mac OS X. Whatever common operating system you are using, this article should give you what you need to be able to start developing Express apps.</dd>
 <dt><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/Tutorial_local_library_website">Tutorial de Express: O Website - Biblioteca Local</a></dt>
 <dd>The first article in our practical tutorial series explains what you'll learn, and provides an overview of the "local library" example website we'll be working through and evolving in subsequent articles.</dd>
 <dt><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/Tutorial_local_library_website">Tutorial de Express</a><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/skeleton_website"> Parte 2: Criar um esqueleto de um website</a></dt>
 <dd>This article shows how you can create a "skeleton" website project, which you can then go on to populate with site-specific routes, templates/views, and databases.</dd>
 <dt><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/Tutorial_local_library_website">Tutorial de Express</a><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/skeleton_website"> Parte </a><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/mongoose">3: Usar uma Base de Dados (com Mongoose)</a></dt>
 <dd>This article briefly introduces databases for Node/Express. It then goes on to show how we can use <a href="http://mongoosejs.com/">Mongoose</a> to provide database access for the <em>LocalLibrary</em> website. It explains how object schema and models are declared, the main field types, and basic validation. It also briefly shows a few of the main ways you can access model data.</dd>
 <dt><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/Tutorial_local_library_website">Tutorial de Express Parte 4: Rotas e controladores</a><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/skeleton_website"> </a></dt>
 <dd>In this tutorial we'll set up routes (URL handling code) with "dummy" handler functions for all the resource endpoints that we'll eventually need in the <em>LocalLibrary</em> website. On completion, we'll have a modular structure for our route handling code, that we can extend with real handler functions in the following articles. We'll also have a really good understanding of how to create modular routes using Express.</dd>
 <dt><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/Tutorial_local_library_website">Tutorial de Express Parte</a><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/Displaying_data"> 5: Exibir dados da biblioteca</a></dt>
 <dd>We're now ready to add the pages that display the <em>LocalLibrary</em> website books and other data. The pages will include a home page that shows how many records we have of each model type, and list and detail pages for all of our models. Along the way we'll gain practical experience in getting records from the database, and using templates.</dd>
 <dt><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/Tutorial_local_library_website">Tutorial de Express Parte</a><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/Displaying_data"> 6:</a><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/forms"> Trabalhar com formulários</a></dt>
 <dd>In this tutorial we'll show you how to work with <a href="/en-US/docs/Web/Guide/HTML/Forms">HTML Forms</a> in Express, using Pug, and in particular how to write forms to create, update, and delete documents from the database.</dd>
 <dt><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/Tutorial_local_library_website">Tutorial de Express Parte</a><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/deployment"> 7: Enviar para produção</a></dt>
 <dd>Now you've created an awesome <em>LocalLibrary</em> website, you're going to want to install it on a public web server so that it can be accessed by library staff and members over the Internet. This article provides an overview of how you might go about finding a host to deploy your website, and what you need to do in order to get your site ready for production.</dd>
</dl>

<h2 id="Consulte_também">Consulte também</h2>

<dl>
 <dt><a href="/en-US/docs/Learn/Server-side/Express_Nodejs/Installing_on_PWS_Cloud_Foundry">Installing LocalLibrary on PWS/Cloud Foundry</a></dt>
 <dd>This article provides a practical demonstration of how to install <em>LocalLibrary</em> on the <a href="http://run.pivotal.io">Pivotal Web Services PaaS cloud</a> — this is a full-featured, open source alternative to Heroku, the PaaS cloud service used in Part 7 of the tutorial, listed above. PWS/Cloud Foundry is definitely worth checking out if you are looking for an alternative to Heroku (or another PaaS cloud service), or simply feel like trying something different.</dd>
</dl>

<h2 id="Adicionar_mais_tutoriais">Adicionar mais tutoriais</h2>

<div>
<p>That's the end of the tutorial articles (for now). If you would like to extend it, other interesting topics to cover are:</p>

<ul>
 <li>Using sessions</li>
 <li>User authentication</li>
 <li>User authorisation and permissions</li>
 <li>Testing an Express web application</li>
 <li>Web security for Express web applications.</li>
</ul>

<p>And of course it would be excellent to have an assessment task!</p>
</div>