The document provides an overview of building a REST API with Node.js and Express. It discusses setting up a MongoDB database using Mongoose as an ODM. It describes defining schemas and models, and using models to perform CRUD operations. It also covers creating routes and controllers to build out the REST API endpoints.
In this presentation, Raghavendra BM of Valuebound has discussed the basics of MongoDB - an open-source document database and leading NoSQL database.
----------------------------------------------------------
Get Socialistic
Our website: http://valuebound.com/
LinkedIn: http://bit.ly/2eKgdux
Facebook: https://www.facebook.com/valuebound/
Twitter: http://bit.ly/2gFPTi8
In this presentation, Raghavendra BM of Valuebound has discussed the basics of MongoDB - an open-source document database and leading NoSQL database.
----------------------------------------------------------
Get Socialistic
Our website: http://valuebound.com/
LinkedIn: http://bit.ly/2eKgdux
Facebook: https://www.facebook.com/valuebound/
Twitter: http://bit.ly/2gFPTi8
Since its first appearance in 2009, NodeJS has come a long way. Many frameworks have been developed on top of it. These all make our task easy and quick. It is us who need to decide which one to choose? So, here is the list of top 10 NodeJS frameworks that will help you build an awesome application.
MongoDB is the most famous and loved NoSQL database. It has many features that are easy to handle when compared to conventional RDBMS. These slides contain the basics of MongoDB.
This is a comprehensive slide on implementing web service in iOS . There are basic information on Web Service . There are steps of using web service in iOS. The presentation emphasized on XML Parsing .
mobile in the cloud with diamonds. improved.Oleg Shanyuk
Software development evolution is here. We gotta open source. We making better blocks.
In this presentation I show you some iOS related techniques for automatic data synchronisation. And overall - tools for rapid development and testing your software.
Since its first appearance in 2009, NodeJS has come a long way. Many frameworks have been developed on top of it. These all make our task easy and quick. It is us who need to decide which one to choose? So, here is the list of top 10 NodeJS frameworks that will help you build an awesome application.
MongoDB is the most famous and loved NoSQL database. It has many features that are easy to handle when compared to conventional RDBMS. These slides contain the basics of MongoDB.
This is a comprehensive slide on implementing web service in iOS . There are basic information on Web Service . There are steps of using web service in iOS. The presentation emphasized on XML Parsing .
mobile in the cloud with diamonds. improved.Oleg Shanyuk
Software development evolution is here. We gotta open source. We making better blocks.
In this presentation I show you some iOS related techniques for automatic data synchronisation. And overall - tools for rapid development and testing your software.
This presentation is related to nosql database and nosql database types information. this presentationa also contains discussion about, how mongodb works and mongodb security and mongodb sharding information.
MongoDB Days UK: Building Apps with the MEAN StackMongoDB
Presented by Norberto Leite, Developer Advocate, MongoDB
Experience level: Advanced
Get ready to be MEAN! The MEAN Stack (MongoDB, ExpressJS, AngularJS and Node.js) allows developers to do rapid application development and application scaffolding. In this session, Norberto will walk you through strategies and best practices for building applications on the MEAN stack, the benefits of using such an application stack and the key benefits of each of the individual components.
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB
Today an increasingly large number of products use machine learning and AI to deliver a great personalized user experience, and workplace software is no exception. Spoke goes beyond traditional ticketing with their friendly, AI-powered chatbot that gives workplace teams hours of time back as it automatically responds to questions on Slack, email, SMS, and web. Learn how Spoke uses MongoDB to do dynamic model training in real time from user interaction data and serves thousands of models, with multiple customized models per client.
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBLisa Roth, PMP
Today an increasingly large number of products use machine learning and AI to deliver a great personalized user experience, and workplace software is no exception. Spoke goes beyond traditional ticketing with their friendly, AI-powered chatbot that gives workplace teams hours of time back as it automatically responds to questions on Slack, email, SMS, and web. Learn how Spoke uses MongoDB to do dynamic model training in real time from user interaction data and serves thousands of models, with multiple customized models per client.
Sure, here's a comprehensive overview of PostgreSQL in about 3000 words:
---
**Introduction to PostgreSQL:**
PostgreSQL is a powerful, open-source object-relational database system known for its reliability, robustness, and extensibility. It was developed by the PostgreSQL Global Development Group and is released under the PostgreSQL License, a free and open-source software license.
**Key Features of PostgreSQL:**
1. **SQL Compliance:** PostgreSQL follows the SQL standards closely, making it compatible with most SQL-based applications. It supports a wide range of SQL features, including complex queries, transactions, and various data types.
2. **Data Integrity:** PostgreSQL ensures data integrity through constraints, such as unique, primary key, foreign key, and check constraints. These constraints help maintain the consistency and accuracy of the data stored in the database.
3. **Advanced Data Types:** PostgreSQL offers a rich set of data types, including primitive types (e.g., integer, text, boolean) and advanced types (e.g., arrays, JSON, XML, geometric types). This flexibility allows users to store and manipulate diverse types of data efficiently.
4. **Extensibility:** PostgreSQL is highly extensible, allowing users to define custom data types, functions, and procedural languages. Additionally, users can create extensions to add extra functionalities to the database system.
5. **Concurrency Control:** PostgreSQL employs multiversion concurrency control (MVCC) to manage concurrent transactions effectively. This mechanism ensures that multiple transactions can access and modify data concurrently without interfering with each other.
6. **Scalability:** PostgreSQL supports both vertical and horizontal scalability. Vertical scalability involves adding more resources (e.g., CPU, memory) to a single server, while horizontal scalability involves distributing data across multiple servers using techniques like sharding and replication.
7. **High Availability:** PostgreSQL provides built-in features for achieving high availability, such as streaming replication, automatic failover, and online backups. These features help minimize downtime and ensure continuous access to data.
8. **Security:** PostgreSQL offers various security features, including role-based access control (RBAC), SSL/TLS encryption, and data masking. Administrators can define fine-grained access controls to restrict user privileges and protect sensitive data.
9. **Full Text Search:** PostgreSQL includes a powerful full-text search engine, which supports advanced search features like stemming, ranking, and phrase matching. This feature is especially useful for applications that require complex text search capabilities.
10. **Rich Ecosystem:** PostgreSQL has a vibrant ecosystem with a large community of developers, contributors, and third-party vendors. It is supported by a wide range of tools, libraries, and frameworks, making it suitable for diverse use cases.
**Architect
This session will provide attendees with hands-on experience and in-depth knowledge of using Node.js as a runtime environment and Express.js as a web framework to build scalable and fast backend systems. Additionally, attendees will learn about Passport.js, a popular authentication middleware for Node.js, and how to use Prisma ORM to handle database operations in a type-safe and efficient manner.
The session will be conducted by experienced developers who have worked with these technologies and will be able to provide valuable insights and best practices. The session will be interactive and include plenty of opportunities for attendees to ask questions and work on real-world projects.
MongoDB World 2019: Fast Machine Learning Development with MongoDBMongoDB
Today an increasingly large number of products use machine learning to deliver a great personalized user experience, and workplace software is no exception. Learn how Spoke uses MongoDB to do dynamic model training in real time from user interaction data and automatically train and serve thousands of models, with multiple customized models per client.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns
Unlocking Business Potential: Tailored Technology Solutions by Prosigns
Discover how Prosigns, a leading technology solutions provider, partners with businesses to drive innovation and success. Our presentation showcases our comprehensive range of services, including custom software development, web and mobile app development, AI & ML solutions, blockchain integration, DevOps services, and Microsoft Dynamics 365 support.
Custom Software Development: Prosigns specializes in creating bespoke software solutions that cater to your unique business needs. Our team of experts works closely with you to understand your requirements and deliver tailor-made software that enhances efficiency and drives growth.
Web and Mobile App Development: From responsive websites to intuitive mobile applications, Prosigns develops cutting-edge solutions that engage users and deliver seamless experiences across devices.
AI & ML Solutions: Harnessing the power of Artificial Intelligence and Machine Learning, Prosigns provides smart solutions that automate processes, provide valuable insights, and drive informed decision-making.
Blockchain Integration: Prosigns offers comprehensive blockchain solutions, including development, integration, and consulting services, enabling businesses to leverage blockchain technology for enhanced security, transparency, and efficiency.
DevOps Services: Prosigns' DevOps services streamline development and operations processes, ensuring faster and more reliable software delivery through automation and continuous integration.
Microsoft Dynamics 365 Support: Prosigns provides comprehensive support and maintenance services for Microsoft Dynamics 365, ensuring your system is always up-to-date, secure, and running smoothly.
Learn how our collaborative approach and dedication to excellence help businesses achieve their goals and stay ahead in today's digital landscape. From concept to deployment, Prosigns is your trusted partner for transforming ideas into reality and unlocking the full potential of your business.
Join us on a journey of innovation and growth. Let's partner for success with Prosigns.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
RISE with SAP and Journey to the Intelligent Enterprise
Node js crash course session 5
1. Node JS crash course
Build REST API | 8:15 pm
Abdul Rahman
Masri Attal
@abed_attal
Elie Hannouch
@eliehannouch
2. ● A REST API (also known as RESTful API) is an application programming
interface (API or web API) that conforms to the constraints of REST
architectural style and allows for interaction with RESTful web services.
What is REST API
● REST which stands for Representational State Transfer, is an architectural
style for providing standards between computer systems on the web and
mostly use JSON as the preferred choice for transferring data as they are
easy to understand and is readable.
3. ● What is server
● Express
● Routing
● Body params
Recap of last week var express = require(“express”)
var app = express();
app.get(‘/’, function(req,res){
res.send(‘First node app’);
}
app.get('/search/:id', function(req, res){
res.send(‘This is id’+req.param.id);
});
var port = Number(process.env.port || 3000);
app.listen(3000,function(){
console.log(“Listening on “ + port + “...”);
}
4. app.get('/search?id=1', function(req, res){
res.send('id: ' + req.query.id);
//req.query.id => give value: 1
});
app.post('/register', (req, res) => {
// logic to save to database
res.status(201).send({message : Saved!})
});
Req query & Error status code
// 401 Unauthorized
app.get('/user', (req, res) => {
res.status(401).send({message : "You need to login to view this"})
});
// 500 Internal Server Error
app.post('/500', (req, res) => {
res.status(500).send({message : "I failed. I'm sorry"})
});
5. Express and MongoDB
In this tutorial, we will be using Node, Express and MongoDB to create a REST
API that would support the four operations — GET, POST, PUT and DELETE.
So, our REST API will perform all these four operations.
We will use MongoDB as the NoSQL database to store all our data. MongoDB
stores data in JSON format.
6. Rest API and Front End
Finally, our front-end application (for example React) use the REST API endpoints
hosted on the Express.js server. The application is a Tinder-like application for
the sample_airbnb database, containing information on various listings, available
as part of the sample datasets you can load into the Atlas cluster.
7. Connecting to MongoDB Atlas
● Create a config file in the server directory with your connection string.
● There, assign a new ATLAS_URI variable the value of the connection string.
● Replace the <username> and the <password> with your database username
and password. Once done, your file should look similar to the one below.
● ATLAS_URI=mongodb+srv://<username>:<password>@sandbox.jadwj.mongodb.
net/myFirstDatabase?retryWrites=true&w=majority
9. What is the best way to interact with a database?
There are two common approaches for interacting with a database:
● Using the databases' native query language (e.g. MongoDB)
● Using an Object Data Model ("ODM") or an Object Relational Model ("ORM").
An ODM/ORM represents the website's data as JavaScript objects, which are
then mapped to the underlying database. Some ORMs are tied to a specific
database, while others provide a database-agnostic backend.
12. app.post("/listings/recordSwipe",function (req, res) => {
const dbConnect = dbo.getDb();
const matchDocument = { “title”:”hello” };
dbConnect
.collection("matches")
.insertOne(matchDocument, function (err, result) {
if (err) {
res.status(400).send("Error inserting matches!");}
else {
console.log(`Added a new match with id ${result.insertedId}`);
res.status(204).send(); }
});
});
Execute MongoDB Queries - insertOne
13. We're going to use the Mongoose ODM to access our database.
Mongoose acts as a front end to MongoDB, an open source NoSQL database
that uses a document-oriented data model. A “collection” of “documents” in a
MongoDB database is analogous to a “table” of “rows” in a relational database.
This ODM and database combination is extremely popular in the Node
community, partially because the document storage and query system looks
very much like JSON, and is hence familiar to JavaScript developers.
Using Mongoose and MongoDb
14. Mongoose is installed in your project like any other dependency using NPM.
To install it, use the following command inside your project folder:
npm install mongoose
Installing Mongoose adds all its dependencies, including the MongoDB database
driver, but it does not install MongoDB itself.
Installing Mongoose and MongoDB
15. Connecting to MongoDB using Mongoose
Mongoose requires a connection to a MongoDB database. You can require() and
connect to a locally hosted database with mongoose.connect(), as shown below.
var mongoose = require('mongoose');
var mongoDB = 'mongodb://127.0.0.1/my_database';
mongoose.connect(mongoDB, {useNewUrlParser: true, useUnifiedTopology: true});
var db = mongoose.connection;
db.on('error', console.error.bind(console, 'MongoDB connection error:'));
16. MVC
We can describe the MVC architecture in simple terms:
● Model: the part of our application that will deal
with the database or any data-related
functionality.
● View: everything the user will see — basically, the
pages that we’re going to send to the client.
● Controller: the logic of our site, and the glue
between models and views. Here we call our
models to get the data, then we put that data on
our views to be sent to the users.
17. Defining and creating models
● Models are defined using the Schema interface which allows you to define the
fields stored in each document along with their validation requirements and
default values.
● In addition, you can define static and instance helper methods to make it
easier to work with your data types, and also virtual properties that you can
use like any other field, but which aren't actually stored in the database
● Schemas are then "compiled" into models using the mongoose.model()
method. Once you have a model you can use it to find, create, update, and
delete objects of the given type.
18. The code fragment below shows how you might define a simple schema. First
you require() mongoose, then use the Schema constructor to create a new
schema instance, defining the various fields inside it in the constructor's object
parameter.
Defining schemas
var mongoose = require('mongoose');
//Define a schema
var Schema = mongoose.Schema;
var SomeModelSchema = new Schema({
a_string: String,
a_date: Date
});
var SomeModel = mongoose.model('SomeModel', SomeModelSchema );
19. Schema types (fields)
A schema can have an arbitrary number of fields — each one represents a
field in the documents stored in MongoDB. An example schema showing
many of the common field types and how they are declared is shown below.
● Date
● Number
● Boolean
● etc..
20. Validation
Mongoose provides built-in and custom validators, and synchronous and asynchronous
validators. It allows you to specify both the acceptable range of values and the error message
for validation failure in all cases.
The built-in validators include:
● All SchemaTypes have the built-in required validator. This is used to specify whether the
field must be supplied in order to save a document.
● Numbers have min and max validators.
● Strings have:
○ enum: specifies the set of allowed values for the field.
○ match: specifies a regular expression that the string must match.
○ maxLength and minLength for the string.
22. const express = require('express'); //import express
const router = express.Router()
const teaController = require('../controllers/tea');
router.post('/tea', teaController.newTea);
module.exports = router
Express and Routes
// newTea function for post tea route
const newTea = (req, res, next) => {
res.json({message: "POST new tea"}); //dummyfuncti
};
module.exports = {newTea};
route.js
/controllers/tea.js
const express = require ('express');
const routes = require('./routes/tea');
const app = express();
app.use(express.json());
app.use('/', routes); //to use the routes
const listener = app.listen(process.env.PORT || 3000,
() => { console.log('Your app is listening on port ' +
listener.address().port) })
server.js
23. Once you've created a schema you can use it to create models. The model
represents a collection of documents in the database that you can search,
while the model's instances represent individual documents that you can save
and retrieve.
Using Models
var Athlete = mongoose.model('Athlete', yourSchema);
// Create an instance of model Athlete
var athlete = new Athlete({ name: 'awesome' });
// Save the new model instance, passing a callback
athlete.save(function (err) {
if (err) return handleError(err);
// saved!
});
// find all athletes who play tennis, selecting the 'name' and 'age'
Athlete.find({ 'sport': 'Tennis' }, 'name age', function (err, athletes) {
if (err) return handleError(err);
// 'athletes' list of athletes match the criteria.
})
24. module.exports = (app) => {
const brands = require('../controllers/brand.controller.js');
// Create a new brand
app.post('/brands', brands.create);
// Retrieve all brands
app.get('/brands', brands.findAll);
Creating CRUD REST
Basic GET & POST
25. // Retrieve a single brand with brandId
app.get('/brands/:brandId', brands.findOne);
// Update a brand with brandId
app.put('/brands/:brandId', brands.update);
// Delete a brand with brandId
app.delete('/brands/:brandId', brands.delete);
}
Creating CRUD REST
API by ID : GET & UPDATE & DELETE