Giter Club home page Giter Club logo

jacobgrisham / next.js-docker-redis-sessions-jwt Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 2.0 8.26 MB

Full-stack web app built with React.js, React Components and React Hooks, Next.js, Reactstrap, Node.js, PostgreSQL, Redis for caching, JSON Web Tokens for sessions, and Docker for the development environment.

Dockerfile 4.51% JavaScript 88.36% PLpgSQL 0.70% HTML 4.47% CSS 1.96%
artificial-intelligence docker docker-compose docker-container full-stack-web-development image-recognition javascript jsonwebtoken nextjs nodejs postgresql postgresql-database react reactjs redis redis-cache rest-api server-side-rendering sessions-jwt token-based-authentication

next.js-docker-redis-sessions-jwt's Issues

Fetch Fails When Registering

Here is are the errors in the console:
POST http://localhost:3000/register net::ERR_EMPTY_RESPONSE
TypeError: Failed to fetch

I understand that "Failed to Fetch" is a Network error
Screen Shot 2021-05-02 at 10 31 07 PM

So I checked the Network tab
Screen Shot 2021-05-02 at 11 21 49 PM

I'm using Google Chrome and I thought the new default Referrer-Policy of strict-origin-when-cross-origin was the cause for the Network block. They added this around August 2020. As a potential solution, I added helmet to server.js and set the referrer-policy to the most permissive option: unsafe-url. I also added CORS to whitelist the two localhost ports.

My docker container is building fine, the changes I make on my local machine propagate to the container, the server in a Docker container is hosted on localhost:3000, the client is hosted on localhost:3001, I can access the PostgreSQL database in a Docker container via PSequel, the database tables are created as expected. I suspect the error is Network related and I suspect the solution will take place in server.js, but I must be missing something one or two layers deep.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.