{"id":5802,"date":"2021-11-16T16:20:43","date_gmt":"2021-11-16T19:20:43","guid":{"rendered":"https:\/\/fcnuvem.com.br\/home\/?p=1349"},"modified":"2022-12-05T11:57:47","modified_gmt":"2022-12-05T14:57:47","slug":"blog-parte-2-crie-uma-api-rest-em-nodejs-typescript","status":"publish","type":"post","link":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/","title":{"rendered":"Parte 2 &#8211; Crie uma API REST em NodeJS + TypeScript"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"730\" height=\"205\" src=\"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Blog-730x205-FCnuvem-APIrest-1.png\" alt=\"\" class=\"wp-image-1351\" srcset=\"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Blog-730x205-FCnuvem-APIrest-1.png 730w, https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Blog-730x205-FCnuvem-APIrest-1-300x84.png 300w\" sizes=\"auto, (max-width: 730px) 100vw, 730px\" \/><figcaption><sub><strong>Autora:<\/strong>\u00a0Jakeliny\u00a0Gracielly\u00a0<\/sub><\/figcaption><\/figure>\n\n\n\n<p>Seguindo a parte 1 n\u00f3s iniciamos o projeto com um&nbsp;<em>hello<\/em><em>&nbsp;<\/em><em>word<\/em>, agora vamos nos conectar com o&nbsp;MongoDB.&nbsp;<\/p>\n\n\n\n<p>Vamos criar o arquivo&nbsp;&nbsp;db.ts:&nbsp;<br>touch&nbsp;server\/db.ts&nbsp;<\/p>\n\n\n\n<p>Dentro desse arquivo vamos colocar os seguintes comandos:&nbsp;<\/p>\n\n\n\n<p>import&nbsp;* as&nbsp;mongoose&nbsp;from&nbsp;&#8216;mongoose&#8217;;&nbsp;<\/p>\n\n\n\n<p>class&nbsp;DataBase&nbsp;{&nbsp;<\/p>\n\n\n\n<p>private&nbsp;DB_URI = &#8216;mongodb:\/\/127.0.0.1\/clients&#8217;;&nbsp;<\/p>\n\n\n\n<p>private&nbsp;DB_CONNECTION;&nbsp;<\/p>\n\n\n\n<p>constructor()&nbsp;{ }&nbsp;<\/p>\n\n\n\n<p>createConnection() {&nbsp;<\/p>\n\n\n\n<p>mongoose.connect(this.DB_URI);&nbsp;<\/p>\n\n\n\n<p>this.logger(this.DB_URI);&nbsp;<\/p>\n\n\n\n<p>}&nbsp;<\/p>\n\n\n\n<p>closeConnection(message,&nbsp;callback) {&nbsp;<\/p>\n\n\n\n<p>this.DB_CONNECTION.close(() =&gt; {&nbsp;<\/p>\n\n\n\n<p>console.log(&#8216;Mongoose&nbsp;foi desconectado pelo: &#8216; +&nbsp;message);&nbsp;<\/p>\n\n\n\n<p>callback();&nbsp;<\/p>\n\n\n\n<p>})&nbsp;<\/p>\n\n\n\n<p>}&nbsp;<\/p>\n\n\n\n<p>logger(uri) {&nbsp;<\/p>\n\n\n\n<p>this.DB_CONNECTION&nbsp;=&nbsp;mongoose.connection;&nbsp;<\/p>\n\n\n\n<p>this.DB_CONNECTION.on(&#8216;connected&#8217;, () =&gt;&nbsp;console.log(&#8216;Mongoose&nbsp;est\u00e1 conectado));&nbsp;<\/p>\n\n\n\n<p>this.DB_CONNECTION.on(&#8216;error&#8217;,&nbsp;error&nbsp;=&gt;&nbsp;console.error.bind(console, &#8220;Erro na conex\u00e3o: &#8221; +&nbsp;error));&nbsp;<\/p>\n\n\n\n<p>this.DB_CONNECTION.on(&#8216;disconnected&#8217;, () =&gt;&nbsp;console.log(&#8220;Mongoose&nbsp;est\u00e1&nbsp;desconectado ));&nbsp;<\/p>\n\n\n\n<p>}&nbsp;<\/p>\n\n\n\n<p>}&nbsp;<\/p>\n\n\n\n<p>export&nbsp;default&nbsp;DataBase;&nbsp;<\/p>\n\n\n\n<p>Com o nosso arquivo de conex\u00e3o&nbsp;realizado&nbsp;vamos cham\u00e1-lo no&nbsp;app.ts, primeiro importamos o arquivo:&nbsp;<\/p>\n\n\n\n<p>import&nbsp;DataBase&nbsp;from&nbsp;\u2018.\/db\u2019;&nbsp;<\/p>\n\n\n\n<p>Criamos o atributo&nbsp;database&nbsp;do tipo&nbsp;DataBase:&nbsp;<\/p>\n\n\n\n<p>private&nbsp;database:&nbsp;DataBase;&nbsp;<\/p>\n\n\n\n<p>No m\u00e9todo construtor instanciamos a classe&nbsp;DataBase:&nbsp;<\/p>\n\n\n\n<p>this.database&nbsp;= new&nbsp;DataBase();&nbsp;<\/p>\n\n\n\n<p>Por \u00faltimo vamos chamar no m\u00e9todo construtor o m\u00e9todo que abre nossa conex\u00e3o para quando a nossa API funcionar, uma das primeiras coisas que ser\u00e1 realizada \u00e9 a abertura da conex\u00e3o&nbsp;<\/p>\n\n\n\n<p>this.database.createConnection();&nbsp;<\/p>\n\n\n\n<p>E pronto, terminamos de escrever os c\u00f3digos necess\u00e1rios para fazer a conex\u00e3o com o&nbsp;MongoDB, vamos testar?&nbsp;<\/p>\n\n\n\n<p>Primeiro certifique-se que o mongo est\u00e1 funcionando na sua m\u00e1quina, se voc\u00ea est\u00e1 no Ubuntu pode executar no seu terminal o comando: mongo&nbsp;<\/p>\n\n\n\n<p>Se der algum erro ou aviso, certifique-se que o&nbsp;MongoDB&nbsp;est\u00e1 instalado e&nbsp;exeute&nbsp;o seguinte comando para iniciar o servi\u00e7o do&nbsp;MongoDB:&nbsp;<\/p>\n\n\n\n<p>sudo&nbsp;service&nbsp;mongod&nbsp;start&nbsp;<\/p>\n\n\n\n<p>E agora podemos testar nosso projeto&nbsp;<\/p>\n\n\n\n<p>npm&nbsp;start&nbsp;<\/p>\n\n\n\n<p>Dentro do arquivo&nbsp;db.ts&nbsp;escrevemos algumas mensagens para determinados estados da nossa conex\u00e3o, se foi bem-sucedida deve aparecer a mensagem \u201cMongoose&nbsp;est\u00e1 conectado\u201d&nbsp;<\/p>\n\n\n\n<p>No pr\u00f3ximo passo vamos criar as fun\u00e7\u00f5es do nosso CRUD&nbsp;<\/p>\n\n\n\n<p>Aguarde o post da terceira parte.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Seguindo a parte 1 n\u00f3s iniciamos o projeto com um&nbsp;hello&nbsp;word, agora vamos nos conectar com o&nbsp;MongoDB.&nbsp; Vamos criar o arquivo&nbsp;&nbsp;db.ts:&nbsp;touch&nbsp;server\/db.ts&nbsp; Dentro desse arquivo vamos colocar os seguintes comandos:&nbsp; import&nbsp;* as&nbsp;mongoose&nbsp;from&nbsp;&#8216;mongoose&#8217;;&nbsp; class&nbsp;DataBase&nbsp;{&nbsp; private&nbsp;DB_URI = &#8216;mongodb:\/\/127.0.0.1\/clients&#8217;;&nbsp; private&nbsp;DB_CONNECTION;&nbsp; constructor()&nbsp;{ }&nbsp; createConnection() {&nbsp; mongoose.connect(this.DB_URI);&nbsp; this.logger(this.DB_URI);&nbsp; }&nbsp; closeConnection(message,&nbsp;callback) {&nbsp; this.DB_CONNECTION.close(() =&gt; {&nbsp; console.log(&#8216;Mongoose&nbsp;foi desconectado pelo: &#8216; +&nbsp;message);&nbsp; callback();&nbsp; })&nbsp; }&nbsp;&hellip;<\/p>\n","protected":false},"author":8,"featured_media":1353,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[94],"tags":[369,370,371],"post_series":[],"class_list":["post-5802","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutoriais","tag-api-rest","tag-nodejs","tag-typescript","entry","has-media"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Parte 2 - Crie uma API REST em NodeJS + TypeScript - Blog da FCamara<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Parte 2 - Crie uma API REST em NodeJS + TypeScript - Blog da FCamara\" \/>\n<meta property=\"og:description\" content=\"Seguindo a parte 1 n\u00f3s iniciamos o projeto com um&nbsp;hello&nbsp;word, agora vamos nos conectar com o&nbsp;MongoDB.&nbsp; Vamos criar o arquivo&nbsp;&nbsp;db.ts:&nbsp;touch&nbsp;server\/db.ts&nbsp; Dentro desse arquivo vamos colocar os seguintes comandos:&nbsp; import&nbsp;* as&nbsp;mongoose&nbsp;from&nbsp;&#8216;mongoose&#8217;;&nbsp; class&nbsp;DataBase&nbsp;{&nbsp; private&nbsp;DB_URI = &#8216;mongodb:\/\/127.0.0.1\/clients&#8217;;&nbsp; private&nbsp;DB_CONNECTION;&nbsp; constructor()&nbsp;{ }&nbsp; createConnection() {&nbsp; mongoose.connect(this.DB_URI);&nbsp; this.logger(this.DB_URI);&nbsp; }&nbsp; closeConnection(message,&nbsp;callback) {&nbsp; this.DB_CONNECTION.close(() =&gt; {&nbsp; console.log(&#8216;Mongoose&nbsp;foi desconectado pelo: &#8216; +&nbsp;message);&nbsp; callback();&nbsp; })&nbsp; }&nbsp;&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog da FCamara\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-16T19:20:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-12-05T14:57:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Thumb-Blog-FCnuvem-APIrest.png\" \/>\n\t<meta property=\"og:image:width\" content=\"260\" \/>\n\t<meta property=\"og:image:height\" content=\"205\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"fcnuvem\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"fcnuvem\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/\"},\"author\":{\"name\":\"fcnuvem\",\"@id\":\"https:\/\/fcamara.com\/blog\/#\/schema\/person\/62d48659a26297896002e2434a44e28a\"},\"headline\":\"Parte 2 &#8211; Crie uma API REST em NodeJS + TypeScript\",\"datePublished\":\"2021-11-16T19:20:43+00:00\",\"dateModified\":\"2022-12-05T14:57:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/\"},\"wordCount\":446,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fcamara.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Thumb-Blog-FCnuvem-APIrest.png\",\"keywords\":[\"API REST\",\"NODEJS\",\"TYPESCRIPT\"],\"articleSection\":[\"Tutoriais\"],\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/\",\"url\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/\",\"name\":\"Parte 2 - Crie uma API REST em NodeJS + TypeScript - Blog da FCamara\",\"isPartOf\":{\"@id\":\"https:\/\/fcamara.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Thumb-Blog-FCnuvem-APIrest.png\",\"datePublished\":\"2021-11-16T19:20:43+00:00\",\"dateModified\":\"2022-12-05T14:57:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#primaryimage\",\"url\":\"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Thumb-Blog-FCnuvem-APIrest.png\",\"contentUrl\":\"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Thumb-Blog-FCnuvem-APIrest.png\",\"width\":260,\"height\":205},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/fcamara.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"aplicativo mobile\",\"item\":\"https:\/\/fcamara.com\/blog\/tags\/aplicativo-mobile\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Parte 2 &#8211; Crie uma API REST em NodeJS + TypeScript\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fcamara.com\/blog\/#website\",\"url\":\"https:\/\/fcamara.com\/blog\/\",\"name\":\"Blog da FCamara\",\"description\":\"Esta \u00e9 a \u00e1rea de insights sobre o mercado de tecnologia.\",\"publisher\":{\"@id\":\"https:\/\/fcamara.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fcamara.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fcamara.com\/blog\/#organization\",\"name\":\"Blog da FCamara\",\"url\":\"https:\/\/fcamara.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/fcamara.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2024\/07\/FCamara-Blog-laranja.webp\",\"contentUrl\":\"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2024\/07\/FCamara-Blog-laranja.webp\",\"width\":459,\"height\":68,\"caption\":\"Blog da FCamara\"},\"image\":{\"@id\":\"https:\/\/fcamara.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fcamara.com\/blog\/#\/schema\/person\/62d48659a26297896002e2434a44e28a\",\"name\":\"fcnuvem\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"fcnuvem\"},\"url\":\"https:\/\/fcamara.com\/blog\/author\/fcnuvem\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Parte 2 - Crie uma API REST em NodeJS + TypeScript - Blog da FCamara","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/","og_locale":"pt_BR","og_type":"article","og_title":"Parte 2 - Crie uma API REST em NodeJS + TypeScript - Blog da FCamara","og_description":"Seguindo a parte 1 n\u00f3s iniciamos o projeto com um&nbsp;hello&nbsp;word, agora vamos nos conectar com o&nbsp;MongoDB.&nbsp; Vamos criar o arquivo&nbsp;&nbsp;db.ts:&nbsp;touch&nbsp;server\/db.ts&nbsp; Dentro desse arquivo vamos colocar os seguintes comandos:&nbsp; import&nbsp;* as&nbsp;mongoose&nbsp;from&nbsp;&#8216;mongoose&#8217;;&nbsp; class&nbsp;DataBase&nbsp;{&nbsp; private&nbsp;DB_URI = &#8216;mongodb:\/\/127.0.0.1\/clients&#8217;;&nbsp; private&nbsp;DB_CONNECTION;&nbsp; constructor()&nbsp;{ }&nbsp; createConnection() {&nbsp; mongoose.connect(this.DB_URI);&nbsp; this.logger(this.DB_URI);&nbsp; }&nbsp; closeConnection(message,&nbsp;callback) {&nbsp; this.DB_CONNECTION.close(() =&gt; {&nbsp; console.log(&#8216;Mongoose&nbsp;foi desconectado pelo: &#8216; +&nbsp;message);&nbsp; callback();&nbsp; })&nbsp; }&nbsp;&hellip;","og_url":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/","og_site_name":"Blog da FCamara","article_published_time":"2021-11-16T19:20:43+00:00","article_modified_time":"2022-12-05T14:57:47+00:00","og_image":[{"width":260,"height":205,"url":"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Thumb-Blog-FCnuvem-APIrest.png","type":"image\/png"}],"author":"fcnuvem","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"fcnuvem","Est. tempo de leitura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#article","isPartOf":{"@id":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/"},"author":{"name":"fcnuvem","@id":"https:\/\/fcamara.com\/blog\/#\/schema\/person\/62d48659a26297896002e2434a44e28a"},"headline":"Parte 2 &#8211; Crie uma API REST em NodeJS + TypeScript","datePublished":"2021-11-16T19:20:43+00:00","dateModified":"2022-12-05T14:57:47+00:00","mainEntityOfPage":{"@id":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/"},"wordCount":446,"commentCount":0,"publisher":{"@id":"https:\/\/fcamara.com\/blog\/#organization"},"image":{"@id":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Thumb-Blog-FCnuvem-APIrest.png","keywords":["API REST","NODEJS","TYPESCRIPT"],"articleSection":["Tutoriais"],"inLanguage":"pt-BR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/","url":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/","name":"Parte 2 - Crie uma API REST em NodeJS + TypeScript - Blog da FCamara","isPartOf":{"@id":"https:\/\/fcamara.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#primaryimage"},"image":{"@id":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Thumb-Blog-FCnuvem-APIrest.png","datePublished":"2021-11-16T19:20:43+00:00","dateModified":"2022-12-05T14:57:47+00:00","breadcrumb":{"@id":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#primaryimage","url":"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Thumb-Blog-FCnuvem-APIrest.png","contentUrl":"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2021\/11\/Thumb-Blog-FCnuvem-APIrest.png","width":260,"height":205},{"@type":"BreadcrumbList","@id":"https:\/\/fcamara.com\/blog\/blog-parte-2-crie-uma-api-rest-em-nodejs-typescript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/fcamara.com\/blog\/"},{"@type":"ListItem","position":2,"name":"aplicativo mobile","item":"https:\/\/fcamara.com\/blog\/tags\/aplicativo-mobile\/"},{"@type":"ListItem","position":3,"name":"Parte 2 &#8211; Crie uma API REST em NodeJS + TypeScript"}]},{"@type":"WebSite","@id":"https:\/\/fcamara.com\/blog\/#website","url":"https:\/\/fcamara.com\/blog\/","name":"Blog da FCamara","description":"Esta \u00e9 a \u00e1rea de insights sobre o mercado de tecnologia.","publisher":{"@id":"https:\/\/fcamara.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fcamara.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Organization","@id":"https:\/\/fcamara.com\/blog\/#organization","name":"Blog da FCamara","url":"https:\/\/fcamara.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/fcamara.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2024\/07\/FCamara-Blog-laranja.webp","contentUrl":"https:\/\/fcamara.com\/blog\/wp-content\/uploads\/2024\/07\/FCamara-Blog-laranja.webp","width":459,"height":68,"caption":"Blog da FCamara"},"image":{"@id":"https:\/\/fcamara.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fcamara.com\/blog\/#\/schema\/person\/62d48659a26297896002e2434a44e28a","name":"fcnuvem","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"fcnuvem"},"url":"https:\/\/fcamara.com\/blog\/author\/fcnuvem\/"}]}},"lang":"br","translations":{"br":5802},"pll_sync_post":[],"_links":{"self":[{"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/posts\/5802","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/comments?post=5802"}],"version-history":[{"count":1,"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/posts\/5802\/revisions"}],"predecessor-version":[{"id":6157,"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/posts\/5802\/revisions\/6157"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/media\/1353"}],"wp:attachment":[{"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/media?parent=5802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/categories?post=5802"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/tags?post=5802"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/fcamara.com\/blog\/wp-json\/wp\/v2\/post_series?post=5802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}