Skip to content

Example web server to demonstrate the difference between MIME types via "Content-Type" HTTP headers and file extensions

License

Notifications You must be signed in to change notification settings

fnogatz/fake-cat-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fake-cat-image

Example web server to demonstrate the difference between MIME types via Content-Type HTTP headers and file extensions. Learning target is that file extensions in an URI might not determine the MIME type of the delivered content.

Installation

As this module has no npm dependencies, you can simply clone this project. It is not published to npm.

Usage

Start the server via npm start. You can change the port in the package.json file or by using npm config set port [PORT]. Default is 8080.

The server provides two end points: /cat.jpg returns an HTML file while the inlined /cat.html results in the actual image file. For both URI the HTTP methods GET and HEAD are supported. All other requests return a 404 status code.

To extend both URI by a prefix you can npm config set base [PREFIX] or edit the package.json. Default is /.

Licence

The cat.jpg image file is public domain. The actual project is MIT-licenced.

About

Example web server to demonstrate the difference between MIME types via "Content-Type" HTTP headers and file extensions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published