New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aircode-app

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aircode-app

A simple webapp framework for AirCode.

  • 0.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

AirCode App

A simple webapp framework for AirCode.

Usage

  1. Install aircode-app as dependencies.

  2. Entry js file:

// @see https://docs.aircode.io/guide/functions/
const App = require('aircode-app');

const app = new App();

app.use(async (ctx, next) => {
  await next();
  console.log('foobar');
});

app.use(async (ctx, next) => {
  const {params} = ctx;
  ctx.set('content-type', 'text/html');
  ctx.body = app.display('./hello.html', {params});
});

module.exports = app.run();
  1. HTML Templates & JS & CSS:
<!-- hello.html -->
<!DOCTYPE html>
<html lang="en">
${app.display('./head.tpl')}
<body>
  <h1>${JSON.stringify(params)}</h1>
</body>
${app.display('./footer.tpl')}
</html>
<!-- head.tpl -->
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
${app.file('./style.css')}
  </style>
</head>
<!-- footer.tpl -->
<script>
${app.file('./script.js')}
</script>
/* style.css */
body {
  background-color: #000;
  color: #fff;
}
// script.js
console.log('hello world');

You may use this template for startup.


That's all.

Enjoy it!

FAQs

Package last updated on 22 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc