
Node.js & endpoints
- or -
Post a project like this$10
- Posted:
- Proposals: 17
- Remote
- #4253329
- Expired
♛ Most Trusted #1 Team |19+ years of expertise in Website, Mobile Apps, Desktop & Console Games. Wordpress, ReactJS, Shopify, Laravel, Python, React Native, Flutter, Unity, Unreal Engine and AR/VR




Ranked #1 In WordPress Development on PPH | SEO Specialist | Web Design & Development

PHP | MYSQL | Node | Angular| Wordpress | CodeIgniter | Jquery | HTML | CSS | Javascript

PPH #1 "Top Rated" Service Provider in Development & IT : Wordpress, Shopify, Magento, Squarespace, ZOHO, WHMCS, Salesforce, Vtiger, Learndash, Moodle

1157028112834237610801153880010889716105446942879461769642642433611193042113608022537323





Description
Experience Level: Entry
I have been coding a server in Node.js & Express. I use Google Firestore for database. In the database, I have 2 collections: "quotes" and "electiondates."
The problem is I can't seem to use 2 paths in my project. Below is a part of my server.js file:
//REST API's:
//electiondates:
app.use('/electiondates', electionDates);
//quotes:
app.use('/quotes', quotes);
so in the above code, localhost:1338/electiondates works fine, but if I try localhost:1338/quotes, it will still call the electiondates path. It seems whatever path I use inside the first app.use() will be the one used.
The problem is I can't seem to use 2 paths in my project. Below is a part of my server.js file:
//REST API's:
//electiondates:
app.use('/electiondates', electionDates);
//quotes:
app.use('/quotes', quotes);
so in the above code, localhost:1338/electiondates works fine, but if I try localhost:1338/quotes, it will still call the electiondates path. It seems whatever path I use inside the first app.use() will be the one used.

Fredrik P.
100% (56)Projects Completed
74
Freelancers worked with
51
Projects awarded
31%
Last project
18 Aug 2024
Sweden
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies