Git Product home page Git Product logo

url_shortener's Introduction

Setup

docker-compose up Visit: localhost:81

On changes to the API code, just run: docker-compose restart api

Testing

Test API

MAKE SURE THAT YOU HAVE SET UP THE TEST DB Run either docker-compose up test or docker-compose up. This will have the side effect of running migrations.

THEN

docker-compose run -w /usr/src/app/project test bash followed by rspec

OR

docker-compose run -w /usr/src/app/project test rspec

Test Web

docker-compose run frontend /bin/sh followed by react-scripts test

Why no selenium tests?

That would be a bit of a pain to set up, and the tradeoff doesn't make sense yet. If I run all of the other tests, then I will be pretty confident in the whole app, and I can just load it up and use it once, to check it before deploying it.

Why nginx?

To solve the gross CORS code I had to write. You might find it a bit confusing that nginx is forwarding frontend requests to another server, rather than serving up assets directly. You're right, this is a bit weird. The point is to do the bare minimum of work so I could get rid of any CORS-awareness in the API backend. I don't think it makes sense to put more work in here, since I'd start making a bunch of assumptions about a theoretical deploy process.

url_shortener's People

Contributors

skatenerd avatar

Watchers

James Cloos avatar  avatar  avatar

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.