Jhipster blog project sign in failed - jhipster

I tried to create a jhipster project (blog) which is given in the below mentioned youtube url:
https://www.youtube.com/watch?v=XRREt1KB4Y8
When I ran the 'blog' application and tried to sign in I got below error:
POST http://localhost:9000/api/authenticate 404 (Not Found) Zone.js:1805
I think server not able to find Zone.js, but I can see this file in below dir:
..\blog\node_modules\zone.js
Please let me know if I missed something while build or deployment. If you need more information please add comments.
Thanks

It seems you have started only the frontend server and forgot to start the java backend server with mvnw or gradlew depending on which build tool you chose. This is why you get errors 404 for each API calls.
See documentation for more details

Related

Problems Deploying Node App With Render.com

I would like to post a simple stripe integration on render. I apologize in advance for my ignorance on the topic but, since I'm more front-end oriented, it's the first time I've attempted to do such a thing so I would like to ask you
if the repository https://github.com/Luca-Liseros-Ferrari/stripe-example.git is ready to be published, if there is some error that can cause the deploy to fail or if some preliminary operation is required (in the server folder I also have an .env file with the stripe keys and I specified STATIC_DIR = "../client/")
In render.com after clicking on "new" - "web service" and connecting the github repository and considering that from the terminal I start the server.js with the following commands:
cd server
node server.js
how should I fill in the "root directory", "build command" and "start command" fields since it's still not clear to me? Is the root directory the folder that contains the server.js file inside? In my case it would be for example "folderName/server" or simply "server"?
I tried to upload the repository to render but i get the following error message
Failed - Exited with status 1 while running your code.
It also tells me "error cannot find module express"
then I reinstalled express in server folder with npm install express and verified it was already installed. I therefore believe that there is a path error in the phase in which I create the web service.
error snippet
I hope I have provided enough data and I thank anyone who is willing to give me a hand in advance
I solved the problem. I had to specify in render.com in advanced the key - value pairs of my .env file
I noticed it thanks to the Cyclic app which, after loading the repository, warned me that if the app doesn't work it could be because of that
I hope it will help someone

Broadleaf - running locally - problem getting started the API project

I'm trying to run Heat Clinic 6.0.1 locally following getting started tutorial: https://www.broadleafcommerce.com/docs/core/current/getting-started/running-locally
I managed to run admin and site but not the API project. The application starts without problems but when I go to http://localhost:8082/api/v1/swagger-ui.html I get a 404. In the log I see this exception:
javax.servlet.ServletException: Circular view path [error]: would dispatch back to the current handler URL [/error] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
Also trying to log in directly in the API with user broadleafapi and password gives 404.
My environment: Windows 10, jdk 8, maven 3.6
What's wrong? Can you help me? Thank you
Thanks for the report. I reproduced this and it looks like that with the update to Spring Boot 2.0, we did not appropriately override the updated property that specifies the servlet location to embedded Tomcat. Thus, when you went to /api/v1/swagger-ui.html, the application treats it exactly like that URL which is what gave the 404.
Setting the server.servlet.contextPath=/api/v1 property appropriately stripped off this path as part of the servlet context and resolved the 404.
I tested around a bit and was able to 'Authorize' the app (button at the top right of the Swagger page) with the credentials information that get spit out in the logs:
Basic auth configured with user broadleafapi and password: <<generated>>
then I was able to hit the API endpoints.
The changes you will need to make locally in your project to consume the fix are at https://github.com/BroadleafCommerce/DemoSite/commit/422d1cdc37f847afd8bec0be477ab784cbad2e9d#diff-991c59b6dbb0f619b8570d8f8779eaddR11. You will notice that I moved the original definition in default.properties over to common.properties and I recommend that you do the same. To be clear, follow these steps:
Delete the server.servlet.contextPath entry in `api/src/main/resources/runtime-properties/default.properties
Change server.servletPath in api/src/main/resources/runtime-properties/common.properties to server.servlet.contextPath
Thanks for trying out Broadleaf and the report, sorry for the rough early start!

Integrating jQuery-File-Upload plugin with blueimp-file-upload-node npm module

I am trying to integrate the jQuery-File-Upload (https://github.com/blueimp/jQuery-File-Upload) with the npm module "blueimp-file-upload-node" to process file uploads.
Sadly, this package "blueimp-file-upload-node" has not been documented yet.
The frontend integration is working correctly, but I am struggling to get the upload functionality working.
I have read and followed this section:
https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#using-jquery-file-upload-ui-version-with-nodejs which tells me to start the service by running:
./node_modules/blueimp-file-upload-node/server.js (notice, the path of this file is within my node_modules folder)
I would like to have the file uploader as a route of my app, (i.e. /upload) not a separate service, on a different port.
How would I go about that?
My code is here:
https://github.com/robsilva/fileUploader
I really appreciate if anyone can shed some light here.
Seems like you are looking for the express middleware
https://github.com/aguidrevitch/jquery-file-upload-middleware

Implementing authentication with passport / node.js and getting error

I had already implemented authentication for the app I'm working on but am trying to refactor it based on a recent tutorial I did which I thought was very clear and also involved adding facebook / google / twitter auth which I would like to do.
So far, I've updated the user model and defined my local strategy for signup but when I go to try and run the app now, I'm getting an error. I have the app uploaded to github and wondered if somebody would be able to check it out and see where I'm going wrong. The error is pointing to a part of the index file until node_modules / express but I cannot work out what's up and I'd like to know before I proceed further.
Latest commit is under: https://github.com/DaveBage83/friendly-invention
Thanks!
A few things for you notice.
1 - Do not commit the node_modules folder. Once you have all your dependencies in the package.json file, the npm install will download all of for you again.
2 - This code is full of erros. I won't put everything here, I believe you find them by yourself. Otherwise, put the specific code here, so we can help you out.
About the question:
In you app.js file.
...
authRoutes = require('./routes/index')(app, passport)
...
If you look at the ./routes/index, you'll see that it is exporting a route object, witch does not expect the two parameters. (e.g. (app, passport)).
Hope it can still help you.

ExpressJS, NodeJs, and MongoDB CRUD Skeleton - Mac

I have recently started working with MongoDB and had it working for a small web test with node JS However. I new my implementation wasn't following a decent MVC structure. I began searching and found this website and read through it. It's implementation look good as well as following a good MVS skeleton structure.
Express/NodeJS/MongoDB CRUD Skeleton
I got to the part where he says 'HOORAY! We've got a functioning web server that is talking to Mongo. Part 1 is accomplished." Unfortunately, I went the local host specified and it says the 'site cannot be reached'. I am still fairly new to NodeJs, Mongo and Express and cannot figure out why it is not working.
I am not sure if I have done a step wrong time and time again which I doubt or if there something is missing that is stopping me from having it working.
The part before it says:
Awesome. Now to test it's all working in the terminal type npm start and you shouldn't see any errors:
kcoleman-mbp:nodewebapp kcoleman$ npm start
> nodewebapp#0.0.1 start /Users/kcoleman/Documents/projects/nodewebapp
> node ./bin/www
That part I get the same outcome with:
nodewebApp and node./bin/www
The page says to navigate to 127.0.0.0:3000, but the localhost usualy defaults to 127.0.0.1. I didn't see any code in the page where he defines the port to 127.0.0.0.
So try connecting to 127.0.0.1:3000.
Coming to nodewebApp and node./bin/www, it could be because the command might be present in pacakge.json. If you delete the nodewebApp from package.json, you won't be seeing the same in the command.

Resources