Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
strayfade committed Feb 15, 2024
1 parent 2b86f02 commit eeef8ee
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 683 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"useTabs": false,
"jsxSingleQuote": true,
"printWidth": 120
}
}
16 changes: 8 additions & 8 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@ App.use(RequestBlocking.Middleware)
// Sources
App.get(
'/favicon.ico',
WrapAsync(async(req, res) => {
WrapAsync(async (req, res) => {
res.sendFile(path.resolve(__dirname, 'assets/Icon.ico'))
}),
)
App.get(
'/robots.txt',
WrapAsync(async(req, res) => {
WrapAsync(async (req, res) => {
res.sendFile(path.resolve(__dirname, 'assets/robots.txt'))
}),
)

// Default Routing
App.get(
'/',
WrapAsync(async(req, res) => {
WrapAsync(async (req, res) => {
const Article = await fs.readFile('./posts/_None.md', { encoding: 'utf-8' })
let Lang = require(GetLanguagePath(req))
let Page = await GeneratePageCached(req, Article, Lang, AvailablePages, AvailablePages.Home, '')
Expand All @@ -69,13 +69,13 @@ App.get(
)
App.get(
'/:path',
WrapAsync(async(req, res) => {
WrapAsync(async (req, res) => {
res.redirect('/' + GetLanaguageShort(req) + '/' + req.params.path)
}),
)
App.get(
'/:localization/:path',
WrapAsync(async(req, res) => {
WrapAsync(async (req, res) => {
let Lang = {}
if (Languages.includes(req.params.localization))
Lang = require('./localization/' + req.params.localization + '.json')
Expand Down Expand Up @@ -113,11 +113,11 @@ App.get(
)

// Error Handling Middleware
const ErrorLogger = async(error, req, res, next) => {
const ErrorLogger = async (error, req, res, next) => {
Log('ERROR: ' + error)
next(error)
}
const ErrorHandler = async(error, req, res, next) => {
const ErrorHandler = async (error, req, res, next) => {
await SendError(500, req, res, AvailablePages, AvailablePages.Dynamic, error, Languages)
}
App.use(ErrorLogger)
Expand All @@ -128,4 +128,4 @@ let Port = process.env.PORT || parseInt(process.argv[2])
App.listen(Port, () => {
Log('Listening on port ' + Port)
Log('Link: http://localhost:' + Port)
})
})
6 changes: 3 additions & 3 deletions Build.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const ObfuscatorOptions = {
}
const Obfuscate = !process.argv[2] || !process.argv[2].includes('--skipobfuscation')

const PackStylesheets = async() => {
const PackStylesheets = async () => {
Log('[BUILD] - Merging CSS files...')
let Stylesheet = ''
let filenames = fs.readdirSync(__dirname + '/css')
Expand All @@ -37,7 +37,7 @@ const PackStylesheets = async() => {
Log('[BUILD] - Finished file: ' + p)
}

const PackScripts = async() => {
const PackScripts = async () => {
Log('[BUILD] - Merging Javascript files...')
let Script = ''
let filenames = fs.readdirSync(__dirname + '/scripts')
Expand Down Expand Up @@ -73,4 +73,4 @@ const PackScripts = async() => {
}

PackStylesheets()
PackScripts()
PackScripts()
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# [**strayfade.com**](https://strayfade.com)

Strayfade/Website is the public source code of [Strayfade.com](https://strayfade.com)

> Do you know a language that isn't English? You can contribute to this repository by translating for us!
>
> The project's localization files are in the `localization` directory. Simply copy one of the existing ones, rename it to the locale you are translating for, and translate the values in the JSON file.
`strayfade/website` is the public source code of [strayfade.com](https://strayfade.com)

### Usage

1. Install [Node.js](https://nodejs.org/en/download/) (obviously)
1. Install [Node.js](https://nodejs.org/en/download/)

2. Clone this repository and `cd` into it:

```Bash
git clone https://github.com/Strayfade/Website.git
cd Website
git clone https://github.com/strayfade/website.git
cd website
```

3. Install packages using the command `npm i`

4. Run the command `npm develop` to start the server (this automatically builds static files and listens on port `3000`).
4. Run the command `npm run prod` to start the server (this automatically builds static files and listens on port `3000`).

5. Navigate to the site, hosted locally at [localhost:3000](http://localhost:3000) by default.
5. Navigate to the site, hosted locally at [127.0.0.1:3000](http://127.0.0.1:3000) by default.
Loading

0 comments on commit eeef8ee

Please sign in to comment.