- Install
typescript,tslib, andsvelte-checkfor dev mode
pnpm i -D typescript tslib svelte-check- Add a
tsconfig.json
For brevity, filenames include parent directory(s). - substitutes /.
If installing Strapi fresh, and you're a filthy, untyped rotten scoundrel, remember to add compilerOptions.jsx = "react" as shown below in jsconfig.json to avoid the IDE SquiggleMonster.
npx create-strapi-app@latest --quickstart --no-run strapi-dashborednpm run strapi generatesrc/middlewares/redirect.jsconfig/middlewares.js| > With this code, you can add your custom routes in swagger, read the documentation if you have any further questions. | |
| ## Tested on: | |
| 1. Node 18.17.1 | |
| 1. Strapi 4.15.5 | |
| 1. Language: Typescript |
| /** | |
| * @description: Handler entry point. | |
| * - Note AWS CloudFront Functions use a modified ECMAScript 5.1 compatible runtime and NOT NodeJS. | |
| * - Use var, not const or let | |
| * - Use string concatenation and not template literals | |
| * - Beware that the CloudFront Functions Console editor and test environment do NOT mimic CloudFront 100% | |
| * @date 2022-01-26 | |
| * @param {object} event: A CloudFront Function event (expecting a Viewer Request event) | |
| * @return {object}: A CloudFront response or request object (depends whether conditions allow pass through or 301 redirect) | |
| */ |
| // This is based on original code from http://stackoverflow.com/a/22649803 | |
| // with special credit to error454's Python adaptation: https://gist.github.com/error454/6b94c46d1f7512ffe5ee | |
| function EnhanceColor(normalized) { | |
| if (normalized > 0.04045) { | |
| return Math.pow( (normalized + 0.055) / (1.0 + 0.055), 2.4); | |
| } | |
| else { return normalized / 12.92; } | |
| } |
| ; Language: English | |
| ; VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV | |
| ; > Uses unicode. Save this file as utf-8 with BOM. < | |
| ; > Else it shall not work. < | |
| ; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| ; | |
| #NoEnv ; Recommended | |
| SendMode Event | |
| SetWorkingDir %userprofile% ; Ensures a consistent starting directory. | |
| ; |
| #!/bin/bash | |
| # Stop all containers | |
| containers=`docker ps -a -q` | |
| if [ -n "$containers" ] ; then | |
| docker stop $containers | |
| fi | |
| # Delete all containers | |
| containers=`docker ps -a -q` | |
| if [ -n "$containers" ]; then | |
| docker rm -f -v $containers |
| /* iPhone 6 landscape */ | |
| @media only screen and (min-device-width: 375px) | |
| and (max-device-width: 667px) | |
| and (orientation: landscape) | |
| and (-webkit-min-device-pixel-ratio: 2) | |
| { } | |
| /* iPhone 6 portrait */ | |
| @media only screen | |
| and (min-device-width: 375px) |
| # SYNTAX: | |
| var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches) | |
| var pattern = /pattern/attributes; # same as above | |
| # BRACKETS: | |
| [...]: Any one character between the brackets. | |
| [^...]: Any one character not between the brackets. |