dalenguyen / rest-api-node-typescript Goto Github PK
View Code? Open in Web Editor NEWBuilding RESTful Web APIs with Node.js, Express, MongoDB and TypeScript
Home Page: https://restful-api-node-typescript.books.dalenguyen.me
Building RESTful Web APIs with Node.js, Express, MongoDB and TypeScript
Home Page: https://restful-api-node-typescript.books.dalenguyen.me
sorry, I was blind. wrong repo...
sorry, I was blind. wrong repo...
The following line of code causes this error to occur:
rest-api-node-typescript/lib/app.ts
Line 28 in 3e1ad72
Cannot assign to 'Promise' because it is a read-only property.ts(2540)
sorry, I was blind. wrong repo...
Sorry to open this issue but it is the only way that I found to communicate with you.
I have a question about how to chain the routes of another feature beautifully.
For example, I have seen that many programmers use this form a lot:
app.use ('/ api / genres', genres);
app.use ('/ api / customers', customers);
app.use ('/ api / movies', movies);
app.use ('/ api / rentals', rentals);
app.use ('/ api / users', users);
app.use ('/ api / auth', auth);
app.use ('/ api / returns', returns);
where the second value is an express router
How could I do this to make it look nice in crmRoutes.ts so that it looks beautiful and clean?
H, can you maybe help me in setting up multer? I'm not sure where to add the middleware to the route where I want to use it. If you need code let me know but I can't seem to get it to work.
sorry, I was blind. wrong repo... How to I delete this?
Hello dalenguyen,
I want to apply '/api/v1' prefix to your API, but I do not know how to do it. Can you help me?
Thank
Firstly thanks for your tutorial and also sorry if this is not the place to post this, as this is more a question rather than an issue.
So if you use the import statement in the server.ts file as follows:
import app from "./app";
It will pick the export reference from your app.ts file, everything works fine.
On the other hand if you use:
import app from "app";
VSCode will be able to pick the reference from the app.ts and is able to tell you that your import app is correctly imported and is able to trace back where does it come from, but the typescript compiler (probably correctly) fails as it's not able to find the module "app".
Why is this happening, what piece of knowledge am I missing?
Thanks and again sorry if this is not the place to post this.
Hi
I'm having issues with getting certain functions to work. I can register & login using passport just fine. The problem I'm having is if someone is making a request and I want to check "req.user" || "req.isAuthenticated()"
I'm also using passport-local-mongoose for only local authentication.
Any help will be gladly appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.