GithubHelp home page GithubHelp logo

udacity / cloud-developer Goto Github PK

View Code? Open in Web Editor NEW
360.0 19.0 3.6K 27.15 MB

content for Udacity's cloud developer nanodegree

TypeScript 83.68% JavaScript 9.59% HTML 4.22% CSS 1.54% Shell 0.04% SCSS 0.93%

cloud-developer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloud-developer's Issues

Error code of Elifecycle

"npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] dev: ts-node-dev --respawn --transpileOnly ./src/server.ts
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above."

Has anyone seen this before and what are the common solutions? I was worried it had to do with laptop RAM based on the first line of error code, but there seems to be more. Any help would be greatly appeciated.

Missing Data folder

I don't see in the repository "sequelize-typescript" and it has caused an error message in Visual Studio.

import {Sequelize} from 'sequelize-typescript';
import { config } from './config/config';

UnhandledPromiseRejectionWarning: Error: Could not find MIME for Buffer <null>

If the URL being passed to Jimp doesn't work (like the original URL provided with the started code), then the error described in the title of this issue is displayed. This is because Jimp.read throws an exception which should be rejected within util.filterImageFromURL

Since I have no time for creating a full PR with a fix, I'm posting my solution here:

export async function filterImageFromURL(inputURL: string) {
  const photo = await Jimp.read(inputURL);
  const outPath = `${__dirname}/tmp/filtered.${Math.floor(
    Math.random() * 2000
  )}.jpg`;
  const processedImage = await photo
    .resize(256, 256) // resize
    .quality(60) // set JPEG quality
    .greyscale() // set greyscale
    .writeAsync(outPath);
  return outPath;

Error In utilts.ts for starter code for preoject 2

The filterImageFromURL is only working for certain URLs and failing for some valid ones.The server came up with error of could not MIME type for Buffer which originates from Jimp.read
.Please help to resolve this issue

error in starting the server

When I'm writing the command 'npm run dev' ,it is showing error and I'm unable to start the server.

C:\Users\GENIUS>npm run dev

[email protected] dev C:\Users\GENIUS
ts-node-dev --respawn --transpileOnly ./src/server.ts

Using ts-node version 8.10.1, typescript version 3.8.3
(node:11848) UnhandledPromiseRejectionWarning: TypeError: express_1.default is not a function
at C:\Users\GENIUS\src\server.ts:10:22
at step (C:\Users\GENIUS\src\server.ts:33:23)
at Object.next (C:\Users\GENIUS\src\server.ts:14:53)
at C:\Users\GENIUS\src\server.ts:8:71
at new Promise ()
at __awaiter (C:\Users\GENIUS\src\server.ts:4:12)
at C:\Users\GENIUS\src\server.ts:6:2
at Object. (C:\Users\GENIUS\src\server.ts:86:3)
at Module._compile (internal/modules/cjs/loader.js:1133:30)
at Module._compile (C:\Users\GENIUS\node_modules\source-map-support\source-map-support.js:547:25)
(node:11848) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11848) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

rl.on line

rl.on line

API exercise jwt payload should be a plain object

Found that jwt library expects the payload to be a plain object. As seen in the course, we send directly the sequelize model instance, which is not a plain object. To solve it, I used the method short() inside the generateJWT method:

function generateJWT(user: User): string {
    return jwt.sign(user.short(), config.jwt.secret);
}

Resource Temporarily Unavailable

I have gotten this in attempting to clone repositories today. I am on the latest version of GitHub Desktop. I have tried launching Desktop from GitHub as well as pasting the URL into Desktop with the same results.

unexpectedly, retry 0, exit code 0xC0000142, errno 11
C:\Users\succe.I7DESKTOP\AppData\Local\GitHubDesktop\app-2.4.3\resources\app\git\mingw64\libexec\git-core\git-submodule: fork: retry: Resource temporarily unavailable
0 [main] sh (22048) C:\Users\succe.I7DESKTOP\AppData\Local\GitHubDesktop\app-2.4.3\resources\app\git\usr\bin\sh.exe: *** fatal error - cygheap base mismatch detected - 0x1301408/0x1331408.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version should
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
15408498 [main] sh 674 dofork: child -1 - forked process 22048 died unexpectedly, retry 0, exit code 0xC0000142, errno 11
C:\Users\succe.I7DESKTOP\AppData\Local\GitHubDesktop\app-2.4.3\resources\app\git\mingw64\libexec\git-core\git-submodule: fork: Resource temporarily unavailable

The syntax of the command is incorrect.

npm run build displays The syntax of the command is incorrect when it gets to the line of code.
"clean": "rimraf www/ || true",
"build": "npm run clean && tsc && cp package.json www/package.json && mkdir www/tmp/ && cd www && zip -r Archive.zip . && cd ..",.

This seems to be the culprit "&& mkdir www/tmp/"
zip -r Archive.zip . throws it's error if you remove the above line

ERR_TLS_CERT_ALTNAME_INVALID when doing npm i

Hey, just like a heads up, when going through the Serverless stuff, forking and attempting to install the node modules for course4 exercises gives you an error.
image

The reason is because its attempting to snag the AWS, axios, and other packages from the nexus solutions url in the package-lock file., which doesn't work. To fix this on my end, I deleted the package-json and then removed the aws-sdk dependency from the package.json file. Then I just ran 'npm i aws-sdk' which installed the 2.11100 version. Then I ran 'npm i' to install the other packages and their dependencies and to have it auto generate a new package-lock.json file and voila, everything works now.

If you just try to edit the package.json file and add the 2.1110 as the aws-sdk version it will still error out because the other packages in package-lock are pointing to the nexus solutions endpoints rather than npm endpoints.

SQL Injection vulnerability

Hi Gabe, ran "npm install" and received "found 1 high severity vulnerability".

"npm audit" gives link "https://www.npmjs.com/advisories/1146" and recommends package.json updated from "sequelize": "^5.10.0" to "sequelize": "^5.15.1".

Re-running "npm install" resolves issue with "found 0 vulnerabilities".

Fix tslint config

There are several issues with the tslint config provided in the projects. Atleast for c2 restapi & frontend.

  • The rules directory codelyzer does not exist and fails the build.
  • There is a mix of ' and " quotes in the project. " are used in config files, ' mostly in code. The current tslint config treats this as error
  • c2 restapi specific
    ** can't run build in lesson 4, part 7, because authentication isn't handled yet and implicit any is used.

I suggest to use a more relaxed tslint config...

Error: Expected "payload" to be a plain object.

UnhandledPromiseRejectionWarning: Error: Expected "payload" to be a plain object.
...
02/exercises/udacity-c2-restapi/src/controllers/v0/users/routes/auth.router.ts:31:16)

function generateJWT(user: User): string {
    //@TODO Use jwt to create a new JWT Payload containing
    return jwt.sign(user.toJSON(), config.jwt.secret); //toJSON is required 
}

https://stackoverflow.com/questions/47117709/payload-error-in-jsonwebtoken
This was required after npm audit fix for the rest backend. I don't know about the original code. Please advise if I can send a PL please, thanks, G.

Udacity-c2-restapi exercise issue

I had an issue running the udacity-c2-restapi exercise to follow along with the lesson . and I had managed to workaround this and I thought this fix might be helpful for anyone facing the same issue.

Steps :
1- Delete package-lock.json โŒ
2. Update all the npm dependencies to their latest version : here's how โœจ

Upon running the app you'll face this typescript error. ๐Ÿ‘‡
error
The easiest way to fix would be by applying this change to FeedItem and User models at:
src\controllers\v0\feed\models\FeedItem.ts
src\controllers\v0\users\models\User.ts
delete

- export class User extends Model<User>
+ export class User extends Model
- export class FeedItem extends Model<FeedItem>
+ export class FeedItem extends Model

Hope this helps ๐Ÿ™‚

Udacity-c2-restapi exercise "npm run dev" issue

I have an issue running npm run dev in the udacity-c2-restapi exercise to follow along with the lesson. After filling in my details in the dev object and running npm run dev, the server just runs and closes with no output
restapiconfig
image

SignatureDoesNotMatch

Issue location : course02 > exercises > udacity-c2-restapi

  • I had cross-checked the secret key and all stuff
  • changed version from v4 to v2
  • server location is correct.

still in POSTMAN i am getting error, see the image.

3
4
5

Error: Could not find MIME for Buffer <null>

utils.filterImageFromURL() is giving below error. How can this be resolved?

Error: Could not find MIME for Buffer
at Jimp.parseBitmap (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules@jimp\core\src\utils\image-bitmap.js:156:15)
at Jimp.call [as parseBitmap] (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules@jimp\core\src\index.js:400:17)
at parseBitmap (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules@jimp\core\src\index.js:344:14)
at cb (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules@jimp\core\src\index.js:73:14)
at cb (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules@jimp\core\src\request.js:47:9)
at IncomingMessage. (C:\suman\udacity\scb\awsfs\cloud-developer\course-02\project\image-filter-starter-code\node_modules\phin\lib\phin.compiled.js:1:2038)
at IncomingMessage.emit (node:events:538:35)
at endReadableNT (node:internal/streams/readable:1345:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
[ERROR] 16:41:19 Error: Could not find MIME for Buffer

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.