- A simple project where users can request images from the data base and specify their required size
- The server was build using express and nodejs.
- This is the First project in Udacity's Advanced Full-Stack Web Development Nanodegree Program.
- This project had no starter code and was built from scratch.
- This project was written in typescript.
- This project uses jasmine to test the code.
- This project uses prettier configured with Eslint to format the code.
- This project uses nodemon to restart the server when changes are made.
To get started developing right away:
- install all project dependencies with
npm install - start the development server with
npm run start
* The backend server is built using express and nodejs.
* To test the app use this sample url: http://localhost:3000/resize/images?name=imageName&height=heightInNumbers&width=widthInNumbers
* The server will check whether the requested image with those spicified dimensions was already in the database or not.
* If it was, it will return the image from the database.
* If it wasn't, it will check whether the requested image is in the data base or not.
* If it was, it will resize the image and save it to the database and return the result to the user.
In the project directory, you can run:
This will run esLint to check the code for errors.
This will run prettier to format the code.
This will run prettier first then esLint to check the code for errors in one script.
This will convert the code into javascript in the build folder.
This will run the pre-defined tests written in the tests folder using jasmine.
This will run the build and jasmine scripts, which will build the code and run the tests in one script.
This will start the server using nodemon.
As per the project's review, the following points were adjusted:
- Moved imageProcessing function to a separate module in the utils folder.
- Moved jasmine, jasmine-spec-reporter and supertest to devDependencies.
- Added an error message for the user when using "0" as a value for width or height.
- Added imageProcessingSpec to the tests folder to test the imageProcessing function.
- Added missing parameter type in the resize main route file index.ts.
- Added additional tests to the images endpoint.
- Added return type for the imageProcessing function.