We don't need the server to tell us our user agent--we can get it
ourselves through navigator.userAgent and parse it on the frontend.
I've replaced device-detector-js with Bowser because device-detector-js
is really slow, freezing for up to 500ms to parse a single user agent.
This sets up ESLint and its config, and disables a bunch of recommended
lints that currently do not pass. Later PRs/commits will fix those lints
and re-enable them.
POST requests always sent an undefined body without the bodyParser
middleware which isn't included with express by default. Add this
as a new dependency and inject it into the express app. This middleware
will also be useful for any other middleware that we might create.
Also properly send status codes and messages to the client so they
can be handled properly.
Signed-off-by: kingbri <bdashore3@proton.me>
* get rid of node-rest-client and fix types
* remove from package manager
* postAsync is used above its def, need hoisting
* handle client agent undefined, fixes type error
* handle invalid / missing query.name for sanitize
* more type guards
* Make code formatter happy
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
* png-chunks-extract.extract has no create_date
* `new Buffer.from` is not a thing
* handle failed character read
* stop lying about your return value
* what we get for mixing booleans and strings
* localeCompare makes more sense and fixes types
* uhh wtf, there is no callback in readFileSync
* no subtracting Dates, only Numbers (timestamps)
* handle if no file in request
* changing types makes typechecker mad
* handle false or undefined character read
* default param does not exist
* can't have same property assigned twice
* json5.parse expects a string, not buffer
* handle invalid thumbnail type
* handle invalid thumbnail type case
* ignore bad axios typing
* fix ambiguous typing
* types is incorrect? no .destroy(). use type guard
* include intended error handling of refactor
* Make API urls const
---------
Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>