Angular 2 App and Express serving the wrong file type

97 views
Skip to first unread message

markgi...@gmail.com

unread,
Jan 10, 2017, 12:46:49 PM1/10/17
to Express
Hello,

I am having some trouble with my Angular/Express. My static files appear to all be served up as JSON type instead of their actual type. This appears to be causing a 422 error in the browser. Does anyone have ideas as to what could cause this?



My HTML file specifies the type when loading the scripts and CSS.

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>XclarityCloudui</title>
<base href="/">

<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.4/Chart.min.js"></script>
<link href="styles.bundle.css" rel="stylesheet"></head>
<body>
<app-root>Loading...</app-root>
<script type="text/javascript" src="inline.bundle.js"></script><script type="text/javascript" src="vendor.bundle.js"></script><script type="text/javascript" src="main.bundle.js"></script></body>
</html>

Ryan Schmidt

unread,
Jan 12, 2017, 9:21:11 PM1/12/17
to expre...@googlegroups.com

> On Jan 5, 2017, at 14:29, markgi...@gmail.com wrote:
>
> Hello,
>
> I am having some trouble with my Angular/Express. My static files appear to all be served up as JSON type instead of their actual type. This appears to be causing a 422 error in the browser. Does anyone have ideas as to what could cause this?

We would need to see your server code to begin to be able to help you with this.



Reply all
Reply to author
Forward
0 new messages