Skip to content

Commit 0d1beec

Browse files
committed
initial commit
0 parents  commit 0d1beec

14 files changed

+6809
-0
lines changed

.gitignore

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# TypeScript v1 declaration files
45+
typings/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional REPL history
57+
.node_repl_history
58+
59+
# Output of 'npm pack'
60+
*.tgz
61+
62+
# Yarn Integrity file
63+
.yarn-integrity
64+
65+
# dotenv environment variables file
66+
.env
67+
.env.test
68+
69+
# parcel-bundler cache (https://parceljs.org/)
70+
.cache
71+
72+
# next.js build output
73+
.next
74+
75+
# nuxt.js build output
76+
.nuxt
77+
78+
# vuepress build output
79+
.vuepress/dist
80+
81+
# Serverless directories
82+
.serverless/
83+
84+
# FuseBox cache
85+
.fusebox/
86+
87+
# DynamoDB Local files
88+
.dynamodb/

.nowignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.next

next.config.js

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const withCss = require('@zeit/next-css');
2+
const withPurgeCss = require('next-purgecss');
3+
4+
class TailwindExtractor {
5+
static extract(content) {
6+
return content.match(/[A-Za-z0-9-_:\/]+/g) || [];
7+
}
8+
}
9+
10+
// next.config.js
11+
module.exports = withCss(
12+
withPurgeCss({
13+
purgeCssEnabled: ({ dev, isServer }) => !dev && !isServer, // Only enable PurgeCSS for client-side production builds
14+
purgeCss: {
15+
whitelist: ['html', 'body'],
16+
extractors: [
17+
{
18+
extractor: TailwindExtractor,
19+
extensions: ['html', 'js', 'css', 'tsx'],
20+
},
21+
],
22+
},
23+
})
24+
);

now.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": 2,
3+
"public": true,
4+
"name": "upipay",
5+
"builds": [
6+
{
7+
"src": "package.json",
8+
"use": "@now/next@canary",
9+
"config": {
10+
"maxLambdaSize": "49mb"
11+
}
12+
}
13+
],
14+
"routes": [
15+
{
16+
"src": "/_next/static/(?:[^/]+/pages|chunks|runtime)/.+",
17+
"headers": {
18+
"cache-control": "public, max-age=31536000, immutable"
19+
}
20+
}
21+
],
22+
"scope": "vinay"
23+
}

package.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "upipay",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"engines": {
7+
"node": "v10.x"
8+
},
9+
"scripts": {
10+
"test": "echo \"Error: no test specified\" && exit 1",
11+
"dev": "next dev"
12+
},
13+
"keywords": [],
14+
"author": "",
15+
"license": "ISC",
16+
"dependencies": {
17+
"@zeit/next-css": "0.2.1-canary.4",
18+
"clsx": "^1.0.4",
19+
"is-mobile": "^2.0.1",
20+
"next": "^9.0.2",
21+
"qrcode.react": "^0.9.3",
22+
"react": "^16.8.6",
23+
"react-dom": "^16.8.6"
24+
},
25+
"devDependencies": {
26+
"autoprefixer": "^9.6.1",
27+
"cssnano": "^4.1.10",
28+
"next-purgecss": "^3.1.1",
29+
"postcss-easy-import": "^3.0.0",
30+
"tailwindcss": "^1.0.5"
31+
}
32+
}

pages/_app.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import '../styles/index.css';
2+
3+
import React from 'react';
4+
import App, { Container } from 'next/app';
5+
6+
export default class MyApp extends App {
7+
render() {
8+
const { Component, pageProps } = this.props;
9+
10+
return (
11+
<Container>
12+
<Component {...pageProps} />
13+
</Container>
14+
);
15+
}
16+
}

pages/_document.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import Document, { Html, Head, Main, NextScript } from 'next/document';
2+
3+
class MyDocument extends Document {
4+
static async getInitialProps(ctx) {
5+
const initialProps = await Document.getInitialProps(ctx);
6+
return { ...initialProps };
7+
}
8+
9+
render() {
10+
return (
11+
<Html lang="en" className="text-gray-900 antialiased leading-tight">
12+
<Head />
13+
<body className="bg-gray-100">
14+
<Main />
15+
<NextScript />
16+
</body>
17+
</Html>
18+
);
19+
}
20+
}
21+
22+
export default MyDocument;

pages/api/pay.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { getURL } from '../../utils';
2+
3+
export default (req, res) => {
4+
try {
5+
const url = getURL(req.query);
6+
res.writeHead(302, {
7+
Location: url,
8+
});
9+
res.end();
10+
} catch (error) {
11+
console.log(error);
12+
res.status(500).end();
13+
}
14+
};

0 commit comments

Comments
 (0)